diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs index 8d9aa53bf7f3..1eff00ea3219 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json // this example is just showing the usage of "CassandraClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task Exists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json // this example is just showing the usage of "CassandraClusters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs index 8b8f956d370a..994e8e34d48f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubscription() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json // this example is just showing the usage of "CassandraClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraClusterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json // this example is just showing the usage of "CassandraClusters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +111,7 @@ public async Task Delete_CosmosDBManagedCassandraClusterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraClusterPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json // this example is just showing the usage of "CassandraClusters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +175,7 @@ public async Task Update_CosmosDBManagedCassandraClusterPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InvokeCommand_CosmosDBManagedCassandraCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json // this example is just showing the usage of "CassandraClusters_InvokeCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,151 +185,26 @@ public async Task InvokeCommand_CosmosDBManagedCassandraCommand() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); // invoke the operation - CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool", "10.0.1.12") - { - Arguments = -{ -["status"] = "", -}, - }; + CassandraCommandPostBody body = new CassandraCommandPostBody("nodetool status", "10.0.1.12"); ArmOperation lro = await cassandraCluster.InvokeCommandAsync(WaitUntil.Completed, body); CassandraCommandOutput result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } - // CosmosDBManagedCassandraListCommand - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommand_CosmosDBManagedCassandraListCommand() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraListCommand.json - // this example is just showing the usage of "CassandraClusters_ListCommand" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraCommandResult - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraCommandResult.json - // this example is just showing the usage of "CassandraClusters_GetCommandAsync" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - string commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; - await foreach (CassandraClusterCommand item in cassandraCluster.GetCommandAsyncAsync(commandId)) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraBackupsList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackups_CosmosDBManagedCassandraBackupsList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraBackupsList.json - // this example is just showing the usage of "CassandraClusters_ListBackups" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation and iterate over the result - await foreach (CassandraClusterBackupResourceInfo item in cassandraCluster.GetBackupsAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBManagedCassandraBackup - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetBackup_CosmosDBManagedCassandraBackup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraBackup.json - // this example is just showing the usage of "CassandraClusters_GetBackup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraClusterResource created on azure - // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "cassandra-prod-rg"; - string clusterName = "cassandra-prod"; - ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); - CassandraClusterResource cassandraCluster = client.GetCassandraClusterResource(cassandraClusterResourceId); - - // invoke the operation - string backupId = "1611250348"; - CassandraClusterBackupResourceInfo result = await cassandraCluster.GetBackupAsync(backupId); - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBManagedCassandraClusterDeallocate [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json // this example is just showing the usage of "CassandraClusters_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -339,7 +214,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -356,7 +231,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_CosmosDBManagedCassandraClusterStart() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraClusterStart.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json // this example is just showing the usage of "CassandraClusters_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -366,7 +241,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); @@ -383,7 +258,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Status_CosmosDBManagedCassandraStatus() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraStatus.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json // this example is just showing the usage of "CassandraClusters_Status" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -393,7 +268,7 @@ public async Task Status_CosmosDBManagedCassandraStatus() // this example assumes you already have this CassandraClusterResource created on azure // for more information of creating CassandraClusterResource, please refer to the document of CassandraClusterResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string subscriptionId = "subid"; string resourceGroupName = "cassandra-prod-rg"; string clusterName = "cassandra-prod"; ResourceIdentifier cassandraClusterResourceId = CassandraClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs index c902a3be9dd7..2cd453acbc29 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBManagedCassandraDataCenterList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json // this example is just showing the usage of "CassandraDataCenters_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBManagedCassandraDataCenterList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json // this example is just showing the usage of "CassandraDataCenters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs index 8fee33385b38..b80ba9ba5555 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json // this example is just showing the usage of "CassandraDataCenters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBManagedCassandraDataCenterUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json // this example is just showing the usage of "CassandraDataCenters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs index 8cfc8e8f9bf8..6ec8e367fd60 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraKeyspaceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json // this example is just showing the usage of "CassandraResources_ListCassandraKeyspaces" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBCassandraKeyspaceList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs index 61c064ba9d13..440c6ec62203 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraKeyspaceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs index 1a0b8bb08933..0cebe6e108c2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraKeyspaceToManualThroughput_CosmosDBCassandraKeyspaceMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs index 778fe3979f06..b64fcd6c71d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBCassandraTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json // this example is just showing the usage of "CassandraResources_ListCassandraTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBCassandraTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -221,7 +221,6 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs index 9cb69423b219..7243a6925d49 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,6 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() } }, }, - AnalyticalStorageTtl = 500, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -124,7 +123,7 @@ public async Task Update_CosmosDBCassandraTableCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBCassandraTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs index 346457eb5796..aa9956621a33 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBCassandraTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBCassandraTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrate [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateCassandraTableToManualThroughput_CosmosDBCassandraTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs deleted file mode 100644 index fc176283d4a5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultCollection - { - // CosmosDBCassandraViewList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBCassandraViewList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewList.json - // this example is just showing the usage of "CassandraResources_ListCassandraViews" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation and iterate over the result - await foreach (CassandraViewGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultResource result = await collection.GetAsync(viewName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - bool result = await collection.ExistsAsync(viewName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - NullableResponse response = await collection.GetIfExistsAsync(viewName); - CassandraViewGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraKeyspaceResource created on azure - // for more information of creating CassandraKeyspaceResource, please refer to the document of CassandraKeyspaceResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - ResourceIdentifier cassandraKeyspaceResourceId = CassandraKeyspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName); - CassandraKeyspaceResource cassandraKeyspace = client.GetCassandraKeyspaceResource(cassandraKeyspaceResourceId); - - // get the collection of this CassandraViewGetResultResource - CassandraViewGetResultCollection collection = cassandraKeyspace.GetCassandraViewGetResults(); - - // invoke the operation - string viewName = "viewname"; - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, viewName, content); - CassandraViewGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs deleted file mode 100644 index 27e9706ebc5e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewGetResultResource - { - // CosmosDBCassandraViewGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultResource result = await cassandraViewGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBCassandraViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json - // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - CassandraViewGetResultCreateOrUpdateContent content = new CassandraViewGetResultCreateOrUpdateContent(new AzureLocation("placeholder"), new CassandraViewResource("viewname", "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)")) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewGetResult.UpdateAsync(WaitUntil.Completed, content); - CassandraViewGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CassandraViewGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBCassandraViewDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewDelete.json - // this example is just showing the usage of "CassandraResources_DeleteCassandraView" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewGetResultResource created on azure - // for more information of creating CassandraViewGetResultResource, please refer to the document of CassandraViewGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewGetResultResourceId = CassandraViewGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewGetResultResource cassandraViewGetResult = client.GetCassandraViewGetResultResource(cassandraViewGetResultResourceId); - - // invoke the operation - await cassandraViewGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs deleted file mode 100644 index 45d08bf67e5d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CassandraViewThroughputSettingResource - { - // CosmosDBCassandraViewThroughputGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBCassandraViewThroughputGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewThroughputGet.json - // this example is just showing the usage of "CassandraResources_GetCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - CassandraViewThroughputSettingResource result = await cassandraViewThroughputSetting.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewThroughputUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBCassandraViewThroughputUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json - // this example is just showing the usage of "CassandraResources_UpdateCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ThroughputSettingsUpdateData data = new ThroughputSettingsUpdateData(new AzureLocation("placeholder"), new ThroughputSettingsResourceInfo() - { - Throughput = 400, - }) - { - Tags = -{ -}, - }; - ArmOperation lro = await cassandraViewThroughputSetting.CreateOrUpdateAsync(WaitUntil.Completed, data); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToAutoscale - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToAutoscale_CosmosDBCassandraViewMigrateToAutoscale() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToAutoscale" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToAutoscaleAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBCassandraViewMigrateToManualThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MigrateCassandraViewToManualThroughput_CosmosDBCassandraViewMigrateToManualThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json - // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToManualThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CassandraViewThroughputSettingResource created on azure - // for more information of creating CassandraViewThroughputSettingResource, please refer to the document of CassandraViewThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string keyspaceName = "keyspacename"; - string viewName = "viewname"; - ResourceIdentifier cassandraViewThroughputSettingResourceId = CassandraViewThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - CassandraViewThroughputSettingResource cassandraViewThroughputSetting = client.GetCassandraViewThroughputSettingResource(cassandraViewThroughputSettingResourceId); - - // invoke the operation - ArmOperation lro = await cassandraViewThroughputSetting.MigrateCassandraViewToManualThroughputAsync(WaitUntil.Completed); - CassandraViewThroughputSettingResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - ThroughputSettingData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs index 7675e92f83bb..bc6daa48d35d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task GetIfExists_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,6 +164,13 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() }) { Kind = CosmosDBAccountKind.MongoDB, + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), +}, + }, ConsistencyPolicy = new ConsistencyPolicy(DefaultConsistencyLevel.BoundedStaleness) { MaxStalenessPrefix = 200L, @@ -215,20 +222,9 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, - EnableMaterializedViews = false, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls12, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, + EnableBurstCapacity = true, EnablePerRegionPerPartitionAutoscale = true, - Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), -}, - }, Tags = { }, @@ -248,7 +244,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCreateMin.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMin.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +291,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -361,12 +357,10 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( }, } }, - SourceBackupLocation = "westus", RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", RestoreTimestampInUtc = DateTimeOffset.Parse("2021-03-11T22:05:09Z"), IsRestoreWithTtlDisabled = false, }, - EnableMaterializedViews = false, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, Tags = { @@ -387,7 +381,7 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json // this example is just showing the usage of "DatabaseAccounts_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs index c464a4eef5ed..904bac34f6dc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBDatabaseAccountPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json // this example is just showing the usage of "DatabaseAccounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { BackupIntervalInMinutes = 240, BackupRetentionIntervalInHours = 720, - BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Geo, + BackupStorageRedundancy = CosmosDBBackupStorageRedundancy.Local, }, }, NetworkAclBypass = NetworkAclBypass.AzureServices, @@ -126,14 +126,10 @@ public async Task Update_CosmosDBDatabaseAccountPatch() { new ResourceIdentifier("/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName") }, - DiagnosticLogEnableFullTextQuery = EnableFullTextQuery.True, CapacityTotalThroughputLimit = 2000, - CapacityMode = CapacityMode.Provisioned, EnablePartitionMerge = true, - EnableBurstCapacity = true, MinimalTlsVersion = CosmosDBMinimalTlsVersion.Tls, - EnablePriorityBasedExecution = true, - DefaultPriorityLevel = DefaultPriorityLevel.Low, + EnableBurstCapacity = true, EnablePerRegionPerPartitionAutoscale = true, }; ArmOperation lro = await cosmosDBAccount.UpdateAsync(WaitUntil.Completed, patch); @@ -151,7 +147,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBDatabaseAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json // this example is just showing the usage of "DatabaseAccounts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +174,7 @@ public async Task Delete_CosmosDBDatabaseAccountDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriorityChange() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json // this example is just showing the usage of "DatabaseAccounts_FailoverPriorityChange" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +213,7 @@ public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriority [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json // this example is just showing the usage of "DatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +245,7 @@ public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_CosmosDBDatabaseAccountListKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json // this example is just showing the usage of "DatabaseAccounts_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +272,7 @@ public async Task GetKeys_CosmosDBDatabaseAccountListKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStrings() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +302,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStringsMongo() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -336,7 +332,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json // this example is just showing the usage of "DatabaseAccounts_OfflineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -364,7 +360,7 @@ public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json // this example is just showing the usage of "DatabaseAccounts_OnlineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -392,7 +388,7 @@ public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json // this example is just showing the usage of "DatabaseAccounts_ListReadOnlyKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -419,7 +415,7 @@ public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json // this example is just showing the usage of "DatabaseAccounts_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -447,7 +443,7 @@ public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNameExists() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json // this example is just showing the usage of "DatabaseAccounts_CheckNameExists" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -471,7 +467,7 @@ public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNam [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json // this example is just showing the usage of "DatabaseAccounts_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -502,7 +498,7 @@ public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json // this example is just showing the usage of "DatabaseAccounts_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -533,7 +529,7 @@ public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json // this example is just showing the usage of "DatabaseAccounts_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -563,7 +559,7 @@ public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json // this example is just showing the usage of "Database_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -595,7 +591,7 @@ public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json // this example is just showing the usage of "Database_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -627,7 +623,7 @@ public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json // this example is just showing the usage of "Database_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -658,7 +654,7 @@ public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinit [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json // this example is just showing the usage of "Collection_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -691,7 +687,7 @@ public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json // this example is just showing the usage of "Collection_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -724,7 +720,7 @@ public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json // this example is just showing the usage of "Collection_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -756,7 +752,7 @@ public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDef [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json // this example is just showing the usage of "CollectionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -790,7 +786,7 @@ public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json // this example is just showing the usage of "DatabaseAccountRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -822,7 +818,7 @@ public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegion [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json // this example is just showing the usage of "PercentileSourceTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -855,7 +851,7 @@ public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json // this example is just showing the usage of "PercentileTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -887,7 +883,7 @@ public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPercentileGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json // this example is just showing the usage of "Percentile_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +914,7 @@ public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json // this example is just showing the usage of "CollectionPartitionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -952,7 +948,7 @@ public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json // this example is just showing the usage of "CollectionPartition_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -985,7 +981,7 @@ public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json // this example is just showing the usage of "CollectionPartition_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1018,7 +1014,7 @@ public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeId_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1052,7 +1048,7 @@ public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMetricsPartitionKeyRangeIdRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeIdRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs index a460a410eecd..aa3b11dcd756 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBLocationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json // this example is just showing the usage of "Locations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBLocationList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Get_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_CosmosDBLocationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs index f53d344e5350..1dcec648d52c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBLocationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs index e634ffcbe932..2d3629138a1a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json // this example is just showing the usage of "PrivateEndpointConnections_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs index 268966eef58b..83195bbae49b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs index ac2df8555f2e..1248e6de6e54 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs index fab685bff74f..151da8daa2a2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs index 8608a74b625e..38dd897ae8f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBServicesList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBServicesList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json // this example is just showing the usage of "Service_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBServicesList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task CreateOrUpdate_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -189,7 +189,7 @@ public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +234,7 @@ public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -269,7 +269,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -300,7 +300,7 @@ public async Task Exists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -343,7 +343,7 @@ public async Task GetIfExists_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -378,7 +378,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -409,7 +409,7 @@ public async Task Exists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -452,7 +452,7 @@ public async Task GetIfExists_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -487,7 +487,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -518,7 +518,7 @@ public async Task Exists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -561,7 +561,7 @@ public async Task GetIfExists_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -596,7 +596,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -627,7 +627,7 @@ public async Task Exists_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs index c41fae0252bc..1abe5c425467 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_DataTransferServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Update_GraphAPIComputeServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task Update_MaterializedViewsBuilderServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +185,7 @@ public async Task Update_SqlDedicatedGatewayServiceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +217,7 @@ public async Task Get_DataTransferServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +249,7 @@ public async Task Get_GraphAPIComputeServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -313,7 +313,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DataTransferServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBDataTransferServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -341,7 +341,7 @@ public async Task Delete_DataTransferServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_GraphAPIComputeServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -369,7 +369,7 @@ public async Task Delete_GraphAPIComputeServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MaterializedViewsBuilderServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -397,7 +397,7 @@ public async Task Delete_MaterializedViewsBuilderServiceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SqlDedicatedGatewayServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json // this example is just showing the usage of "Service_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs index 21efad21f4bd..58097c690ddc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBClientEncryptionKeysList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json // this example is just showing the usage of "SqlResources_ListClientEncryptionKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBClientEncryptionKeysList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata() { Name = "customerManagedKey", diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs index bf41ec5651cc..0d80044360df 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { Id = "cekName", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", - WrappedDataEncryptionKey = Convert.FromBase64String("VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU="), + WrappedDataEncryptionKey = Convert.FromBase64String("U3dhZ2dlciByb2Nrcw=="), KeyWrapMetadata = new CosmosDBKeyWrapMetadata() { Name = "customerManagedKey", diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs index e68d67db3981..4bfef90fa546 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json // this example is just showing the usage of "SqlResources_ListSqlContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBSqlContainerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,142 +275,5 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "containerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // get the collection of this CosmosDBSqlContainerResource - CosmosDBSqlContainerCollection collection = cosmosDBSqlDatabase.GetCosmosDBSqlContainers(); - - // invoke the operation - string containerName = "mvContainerName"; - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy() - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = -{ -new CosmosDBIncludedPath() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = -{ -}, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerName, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs index 60a45c1c1422..2cb0a773da8a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,143 +156,12 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBSqlContainerRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlContainerRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("containerName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlMaterializedViewCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "mvContainerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - CosmosDBSqlContainerCreateOrUpdateContent content = new CosmosDBSqlContainerCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlContainerResourceInfo("mvContainerName") - { - IndexingPolicy = new CosmosDBIndexingPolicy() - { - IsAutomatic = true, - IndexingMode = CosmosDBIndexingMode.Consistent, - IncludedPaths = -{ -new CosmosDBIncludedPath() -{ -Path = "/*", -Indexes = -{ -new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.String, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -},new CosmosDBPathIndexes() -{ -DataType = CosmosDBDataType.Number, -Precision = -1, -Kind = CosmosDBIndexKind.Range, -} -}, -} -}, - ExcludedPaths = -{ -}, - }, - PartitionKey = new CosmosDBContainerPartitionKey() - { - Paths = -{ -"/mvpk" -}, - Kind = CosmosDBPartitionKind.Hash, - }, - MaterializedViewDefinition = new MaterializedViewDefinition("sourceContainerName", "select * from ROOT"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlContainer.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlContainerResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlContainerData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBSqlContainerDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlContainerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -316,46 +185,12 @@ public async Task Delete_CosmosDBSqlContainerDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBSqlContainerPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerPartitionMerge.json - // this example is just showing the usage of "SqlResources_ListSqlContainerPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerResource created on azure - // for more information of creating CosmosDBSqlContainerResource, please refer to the document of CosmosDBSqlContainerResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerResourceId = CosmosDBSqlContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerResource cosmosDBSqlContainer = client.GetCosmosDBSqlContainerResource(cosmosDBSqlContainerResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlContainer.GetSqlContainerPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBSqlContainerBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBSqlContainerBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json // this example is just showing the usage of "SqlResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs index 5e4592fe8e49..5d4562acd738 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlContainerThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +130,7 @@ public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,91 +158,5 @@ public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigr // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlContainerRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContainerRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlContainerRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlContainerRedistributeThroughput_CosmosDBSqlContainerRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlContainerThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlContainerThroughputSettingResource, please refer to the document of CosmosDBSqlContainerThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string containerName = "containerName"; - ResourceIdentifier cosmosDBSqlContainerThroughputSettingResourceId = CosmosDBSqlContainerThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - CosmosDBSqlContainerThroughputSettingResource cosmosDBSqlContainerThroughputSetting = client.GetCosmosDBSqlContainerThroughputSettingResource(cosmosDBSqlContainerThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlContainerThroughputSetting.SqlContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs index 3020efbbef40..9a889cced632 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json // this example is just showing the usage of "SqlResources_ListSqlDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this CosmosDBSqlDatabaseResource - CosmosDBSqlDatabaseCollection collection = cosmosDBAccount.GetCosmosDBSqlDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs index 266216a4e0b9..ea54a4f3c4d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,61 +87,12 @@ public async Task Update_CosmosDBSqlDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBSqlDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBSqlDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRestore.json - // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - CosmosDBSqlDatabaseCreateOrUpdateContent content = new CosmosDBSqlDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new CosmosDBSqlDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = true, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await cosmosDBSqlDatabase.UpdateAsync(WaitUntil.Completed, content); - CosmosDBSqlDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBSqlDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBSqlDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBSqlDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabasePartitionMerge_CosmosDBSqlDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabasePartitionMerge.json - // this example is just showing the usage of "SqlResources_SqlDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseResource created on azure - // for more information of creating CosmosDBSqlDatabaseResource, please refer to the document of CosmosDBSqlDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseResourceId = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseResource cosmosDBSqlDatabase = client.GetCosmosDBSqlDatabaseResource(cosmosDBSqlDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await cosmosDBSqlDatabase.SqlDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs index 9c0372ea7c5c..95e83d20c338 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +127,7 @@ public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAuto [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,89 +154,5 @@ public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrat // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBSqlDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task SqlDatabaseRedistributeThroughput_CosmosDBSqlDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json - // this example is just showing the usage of "SqlResources_SqlDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBSqlDatabaseThroughputSettingResource created on azure - // for more information of creating CosmosDBSqlDatabaseThroughputSettingResource, please refer to the document of CosmosDBSqlDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier cosmosDBSqlDatabaseThroughputSettingResourceId = CosmosDBSqlDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - CosmosDBSqlDatabaseThroughputSettingResource cosmosDBSqlDatabaseThroughputSetting = client.GetCosmosDBSqlDatabaseThroughputSettingResource(cosmosDBSqlDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await cosmosDBSqlDatabaseThroughputSetting.SqlDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs index a39f7f741c1f..c222847ff175 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json // this example is just showing the usage of "SqlResources_ListSqlRoleAssignments" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs index e8579f522da0..98b3c9c7a4b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs index ace41de6ceb2..95fab667ecfe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json // this example is just showing the usage of "SqlResources_ListSqlRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs index fcc5d2b88afc..cee205ef45a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs index 46805cc4da33..278f1a178cae 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlStoredProcedureList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json // this example is just showing the usage of "SqlResources_ListSqlStoredProcedures" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlStoredProcedureList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs index 4f61a0dc609e..712ab04ff1ff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlStoredProcedureDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlStoredProcedureDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs index fb91cda7ffa2..ee2ea2b672c2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlTriggerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json // this example is just showing the usage of "SqlResources_ListSqlTriggers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlTriggerList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs index 035ee2cf3926..4751bb0a64ef 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Update_CosmosDBSqlTriggerCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlTriggerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlTriggerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs index 59397909014f..e2431bc4d42c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json // this example is just showing the usage of "SqlResources_ListSqlUserDefinedFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs index 33b55d9f70ef..419c1cf14b86 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs index dff9d4501093..7603f0eafad0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json // this example is just showing the usage of "TableResources_ListTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs index 9383ab558139..555ec45ac0b8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBTableReplace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json // this example is just showing the usage of "TableResources_DeleteTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Delete_CosmosDBTableDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBTableCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json // this example is just showing the usage of "TableResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index 18b8079ee86c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountCollection - { - // CosmosDB ThroughputPool Account List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolAccountList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json - // this example is just showing the usage of "ThroughputPoolAccounts_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolAccountResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountResource result = await collection.GetAsync(throughputPoolAccountName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - bool result = await collection.ExistsAsync(throughputPoolAccountName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // get the collection of this CosmosDBThroughputPoolAccountResource - CosmosDBThroughputPoolAccountCollection collection = cosmosDBThroughputPool.GetCosmosDBThroughputPoolAccounts(); - - // invoke the operation - string throughputPoolAccountName = "db1"; - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolAccountName, data); - CosmosDBThroughputPoolAccountResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index 2193863d85ae..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolAccountResource - { - // CosmosDB ThroughputPool Account Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolAccountGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json - // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountResource result = await cosmosDBThroughputPoolAccount.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolAccountCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json - // this example is just showing the usage of "ThroughputPoolAccount_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - CosmosDBThroughputPoolAccountData data = new CosmosDBThroughputPoolAccountData() - { - AccountResourceIdentifier = new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/"), - AccountLocation = new AzureLocation("West US"), - }; - ArmOperation lro = await cosmosDBThroughputPoolAccount.UpdateAsync(WaitUntil.Completed, data); - CosmosDBThroughputPoolAccountResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolAccountData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Account Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolAccountDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json - // this example is just showing the usage of "ThroughputPoolAccount_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolAccountResource created on azure - // for more information of creating CosmosDBThroughputPoolAccountResource, please refer to the document of CosmosDBThroughputPoolAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - string throughputPoolAccountName = "db1"; - ResourceIdentifier cosmosDBThroughputPoolAccountResourceId = CosmosDBThroughputPoolAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - CosmosDBThroughputPoolAccountResource cosmosDBThroughputPoolAccount = client.GetCosmosDBThroughputPoolAccountResource(cosmosDBThroughputPoolAccountResourceId); - - // invoke the operation - await cosmosDBThroughputPoolAccount.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index 79202b0a1e6d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolCollection - { - // CosmosDB ThroughputPool List by Resource Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBThroughputPoolListByResourceGroup() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolResource result = await collection.GetAsync(throughputPoolName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - bool result = await collection.ExistsAsync(throughputPoolName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - NullableResponse response = await collection.GetIfExistsAsync(throughputPoolName); - CosmosDBThroughputPoolResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDB ThroughputPool Create - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBThroughputPoolCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json - // this example is just showing the usage of "ThroughputPool_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this CosmosDBThroughputPoolResource - CosmosDBThroughputPoolCollection collection = resourceGroupResource.GetCosmosDBThroughputPools(); - - // invoke the operation - string throughputPoolName = "tp1"; - CosmosDBThroughputPoolData data = new CosmosDBThroughputPoolData(new AzureLocation("westus2")) - { - MaxThroughput = 10000, - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, throughputPoolName, data); - CosmosDBThroughputPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 7de73e52037f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_CosmosDBThroughputPoolResource - { - // CosmosDB ThroughputPool List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolList.json - // this example is just showing the usage of "ThroughputPools_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (CosmosDBThroughputPoolResource item in subscriptionResource.GetCosmosDBThroughputPoolsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDB ThroughputPool Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBThroughputPoolGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json - // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolResource result = await cosmosDBThroughputPool.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Update - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBThroughputPoolUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json - // this example is just showing the usage of "ThroughputPool_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rg1"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - CosmosDBThroughputPoolPatch patch = new CosmosDBThroughputPoolPatch() - { - MaxThroughput = 10000, - }; - ArmOperation lro = await cosmosDBThroughputPool.UpdateAsync(WaitUntil.Completed, patch); - CosmosDBThroughputPoolResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - CosmosDBThroughputPoolData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDB ThroughputPool Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBThroughputPoolDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json - // this example is just showing the usage of "ThroughputPool_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBThroughputPoolResource created on azure - // for more information of creating CosmosDBThroughputPoolResource, please refer to the document of CosmosDBThroughputPoolResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "rgName"; - string throughputPoolName = "tp1"; - ResourceIdentifier cosmosDBThroughputPoolResourceId = CosmosDBThroughputPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, throughputPoolName); - CosmosDBThroughputPoolResource cosmosDBThroughputPool = client.GetCosmosDBThroughputPoolResource(cosmosDBThroughputPoolResourceId); - - // invoke the operation - await cosmosDBThroughputPool.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs index e1bc69e83dc6..3602779be9e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosTableThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json // this example is just showing the usage of "TableResources_GetTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBTableThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json // this example is just showing the usage of "TableResources_UpdateTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json // this example is just showing the usage of "TableResources_MigrateTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateTableToManualThroughput_CosmosDBTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json // this example is just showing the usage of "TableResources_MigrateTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs deleted file mode 100644 index 41edfd49c1b6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultCollection - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, content); - DataTransferJobGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - DataTransferJobGetResultResource result = await collection.GetAsync(jobName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - bool result = await collection.ExistsAsync(jobName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation - string jobName = "j1"; - NullableResponse response = await collection.GetIfExistsAsync(jobName); - DataTransferJobGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBDataTransferJobFeed - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBDataTransferJobFeed() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json - // this example is just showing the usage of "DataTransferJobs_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this DataTransferJobGetResultResource - DataTransferJobGetResultCollection collection = cosmosDBAccount.GetDataTransferJobGetResults(); - - // invoke the operation and iterate over the result - await foreach (DataTransferJobGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs deleted file mode 100644 index 708eda3a2feb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_DataTransferJobGetResultResource - { - // CosmosDBDataTransferJobCreate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBDataTransferJobCreate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json - // this example is just showing the usage of "DataTransferJobs_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultCreateOrUpdateContent content = new DataTransferJobGetResultCreateOrUpdateContent(new DataTransferJobProperties(new CosmosCassandraDataTransferDataSourceSink("keyspace", "table"), new AzureBlobDataTransferDataSourceSink("blob_container") - { - EndpointUri = new Uri("https://blob.windows.net"), - })); - ArmOperation lro = await dataTransferJobGetResult.UpdateAsync(WaitUntil.Completed, content); - DataTransferJobGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBDataTransferJobGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json - // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobPause - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Pause_CosmosDBDataTransferJobPause() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json - // this example is just showing the usage of "DataTransferJobs_Pause" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.PauseAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobResume - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Resume_CosmosDBDataTransferJobResume() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json - // this example is just showing the usage of "DataTransferJobs_Resume" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.ResumeAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobCancel - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Cancel_CosmosDBDataTransferJobCancel() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json - // this example is just showing the usage of "DataTransferJobs_Cancel" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CancelAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBDataTransferJobComplete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Complete_CosmosDBDataTransferJobComplete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json - // this example is just showing the usage of "DataTransferJobs_Complete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DataTransferJobGetResultResource created on azure - // for more information of creating DataTransferJobGetResultResource, please refer to the document of DataTransferJobGetResultResource - string subscriptionId = "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string jobName = "j1"; - ResourceIdentifier dataTransferJobGetResultResourceId = DataTransferJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); - DataTransferJobGetResultResource dataTransferJobGetResult = client.GetDataTransferJobGetResultResource(dataTransferJobGetResultResourceId); - - // invoke the operation - DataTransferJobGetResultResource result = await dataTransferJobGetResult.CompleteAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DataTransferJobGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs deleted file mode 100644 index 0968bdaf985e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultCollection - { - // CosmosDBSqlDatabaseList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_CosmosDBSqlDatabaseList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceList.json - // this example is just showing the usage of "GraphResources_ListGraphs" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation and iterate over the result - await foreach (GraphResourceGetResultResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultResource result = await collection.GetAsync(graphName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - bool result = await collection.ExistsAsync(graphName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - NullableResponse response = await collection.GetIfExistsAsync(graphName); - GraphResourceGetResultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this GraphResourceGetResultResource - GraphResourceGetResultCollection collection = cosmosDBAccount.GetGraphResourceGetResults(); - - // invoke the operation - string graphName = "graphName"; - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, graphName, content); - GraphResourceGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs deleted file mode 100644 index 8cb4b0ab8964..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_GraphResourceGetResultResource - { - // CosmosDBSqlDatabaseGet - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_CosmosDBSqlDatabaseGet() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceGet.json - // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultResource result = await graphResourceGetResult.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBGraphCreateUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBGraphCreateUpdate() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json - // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - GraphResourceGetResultCreateOrUpdateContent content = new GraphResourceGetResultCreateOrUpdateContent(new AzureLocation("West US"), new WritableSubResource() - { - Id = new ResourceIdentifier("graphName"), - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await graphResourceGetResult.UpdateAsync(WaitUntil.Completed, content); - GraphResourceGetResultResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GraphResourceGetResultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBSqlDatabaseDelete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_CosmosDBSqlDatabaseDelete() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGraphResourceDelete.json - // this example is just showing the usage of "GraphResources_DeleteGraphResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GraphResourceGetResultResource created on azure - // for more information of creating GraphResourceGetResultResource, please refer to the document of GraphResourceGetResultResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string graphName = "graphName"; - ResourceIdentifier graphResourceGetResultResourceId = GraphResourceGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, graphName); - GraphResourceGetResultResource graphResourceGetResult = client.GetGraphResourceGetResultResource(graphResourceGetResultResourceId); - - // invoke the operation - await graphResourceGetResult.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs index 171ac7602b74..884a5de89b4c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json // this example is just showing the usage of "GremlinResources_ListGremlinDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBGremlinDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs index 26417666d930..4115956457bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs index 9b3989927d5b..5fa80c12bced 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinDatabaseToManualThroughput_CosmosDBGremlinDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs index 2f42b77bcee8..bf9625f22dd9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json // this example is just showing the usage of "GremlinResources_ListGremlinGraphs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBGremlinGraphList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs index d11a53dee64b..6c87f3ac27cf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Update_CosmosDBGremlinGraphCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBGremlinGraphDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task Delete_CosmosDBGremlinGraphDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBGremlinGraphBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json // this example is just showing the usage of "GremlinResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs index 6e32eb2cd028..5b60e5cea8b7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBGremlinGraphThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBGremlinGraphThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateGremlinGraphToManualThroughput_CosmosDBGremlinGraphMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs index 5284ba8b8b1a..b24366951ad5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBCollections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_CosmosDBMongoDBCollectionList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetIfExists_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,60 +219,6 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - AnalyticalStorageTtl = 500, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, collectionName, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // get the collection of this MongoDBCollectionResource - MongoDBCollectionCollection collection = mongoDBDatabase.GetMongoDBCollections(); - - // invoke the operation - string collectionName = "collectionName"; - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, }) { Options = new CosmosDBCreateUpdateConfig(), diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs index bd7a236329fb..115de11d5acc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,57 +99,6 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() }, } }, - AnalyticalStorageTtl = 500, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await mongoDBCollection.UpdateAsync(WaitUntil.Completed, content); - MongoDBCollectionResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBCollectionData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // CosmosDBMongoDBCollectionRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBCollectionRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MongoDBCollectionCreateOrUpdateContent content = new MongoDBCollectionCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBCollectionResourceInfo("collectionName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -172,7 +121,7 @@ public async Task Update_CosmosDBMongoDBCollectionRestore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBCollectionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,46 +145,12 @@ public async Task Delete_CosmosDBMongoDBCollectionDelete() Console.WriteLine($"Succeeded"); } - // CosmosDBMongoDBCollectionPartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json - // this example is just showing the usage of "MongoDBResources_ListMongoDBCollectionPartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionResource created on azure - // for more information of creating MongoDBCollectionResource, please refer to the document of MongoDBCollectionResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionResourceId = MongoDBCollectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionResource mongoDBCollection = client.GetMongoDBCollectionResource(mongoDBCollectionResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBCollection.GetMongoDBCollectionPartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBMongoDBCollectionBackupInformation [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveContinuousBackupInformation_CosmosDBMongoDBCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json // this example is just showing the usage of "MongoDBResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs index 55353371b7b1..146791154d28 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs @@ -10,104 +10,17 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { public partial class Sample_MongoDBCollectionThroughputSettingResource { - // CosmosDBMongoDBCollectionRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDBCollectionRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBMongoDBCollectionRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollectionRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBCollectionThroughputSettingResource created on azure - // for more information of creating MongoDBCollectionThroughputSettingResource, please refer to the document of MongoDBCollectionThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - string collectionName = "collectionName"; - ResourceIdentifier mongoDBCollectionThroughputSettingResourceId = MongoDBCollectionThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName, collectionName); - MongoDBCollectionThroughputSettingResource mongoDBCollectionThroughputSetting = client.GetMongoDBCollectionThroughputSettingResource(mongoDBCollectionThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBCollectionThroughputSetting.MongoDBContainerRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - // CosmosDBMongoDBCollectionThroughputGet [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBCollectionThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +96,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +130,7 @@ public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBCollectionToManualThroughput_CosmosDBMongoDBCollectionMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs index 34712fe099f6..a6ee36bc5101 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_CosmosDBMongoDBDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,57 +203,5 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this MongoDBDatabaseResource - MongoDBDatabaseCollection collection = cosmosDBAccount.GetMongoDBDatabases(); - - // invoke the operation - string databaseName = "databaseName"; - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs index 742b554179f4..2ca85ea8b87a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,61 +87,12 @@ public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // CosmosDBMongoDBDatabaseRestore - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CosmosDBMongoDBDatabaseRestore() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRestore.json - // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MongoDBDatabaseCreateOrUpdateContent content = new MongoDBDatabaseCreateOrUpdateContent(new AzureLocation("West US"), new MongoDBDatabaseResourceInfo("databaseName") - { - RestoreParameters = new ResourceRestoreParameters() - { - RestoreSource = "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - RestoreTimestampInUtc = DateTimeOffset.Parse("2022-07-20T18:28:00Z"), - IsRestoreWithTtlDisabled = false, - }, - CreateMode = CosmosDBAccountCreateMode.Restore, - }) - { - Options = new CosmosDBCreateUpdateConfig(), - Tags = -{ -}, - }; - ArmOperation lro = await mongoDBDatabase.UpdateAsync(WaitUntil.Completed, content); - MongoDBDatabaseResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MongoDBDatabaseData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - // CosmosDBMongoDBDatabaseDelete [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,38 +114,5 @@ public async Task Delete_CosmosDBMongoDBDatabaseDelete() Console.WriteLine($"Succeeded"); } - - // CosmosDBMongoDBDatabasePartitionMerge - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabasePartitionMerge_CosmosDBMongoDBDatabasePartitionMerge() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseResource created on azure - // for more information of creating MongoDBDatabaseResource, please refer to the document of MongoDBDatabaseResource - string subscriptionId = "subid"; - string resourceGroupName = "rgName"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseResourceId = MongoDBDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseResource mongoDBDatabase = client.GetMongoDBDatabaseResource(mongoDBDatabaseResourceId); - - // invoke the operation - MergeParameters mergeParameters = new MergeParameters() - { - IsDryRun = false, - }; - ArmOperation lro = await mongoDBDatabase.MongoDBDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters); - PhysicalPartitionStorageInfoCollection result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs index 03ef8b9df4fc..7549ee0692fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Samples { @@ -21,7 +20,7 @@ public partial class Sample_MongoDBDatabaseThroughputSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +94,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +127,7 @@ public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigra [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,89 +154,5 @@ public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDataba // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - // CosmosDBMongoDBDatabaseRetrieveThroughputDistribution - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBDatabaseRetrieveThroughputDistribution() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RetrieveThroughputParameters retrieveThroughputParameters = new RetrieveThroughputParameters(new AzureLocation("placeholder"), new RetrieveThroughputPropertiesResource(new WritableSubResource[] - { -new WritableSubResource() -{ -Id = new ResourceIdentifier("0"), -},new WritableSubResource() -{ -Id = new ResourceIdentifier("1"), -} - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil.Completed, retrieveThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // CosmosDBMongoDBDatabaseRedistributeThroughput - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task MongoDBDatabaseRedistributeThroughput_CosmosDBMongoDBDatabaseRedistributeThroughput() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json - // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MongoDBDatabaseThroughputSettingResource created on azure - // for more information of creating MongoDBDatabaseThroughputSettingResource, please refer to the document of MongoDBDatabaseThroughputSettingResource - string subscriptionId = "subid"; - string resourceGroupName = "rg1"; - string accountName = "ddb1"; - string databaseName = "databaseName"; - ResourceIdentifier mongoDBDatabaseThroughputSettingResourceId = MongoDBDatabaseThroughputSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, databaseName); - MongoDBDatabaseThroughputSettingResource mongoDBDatabaseThroughputSetting = client.GetMongoDBDatabaseThroughputSettingResource(mongoDBDatabaseThroughputSettingResourceId); - - // invoke the operation - RedistributeThroughputParameters redistributeThroughputParameters = new RedistributeThroughputParameters(new AzureLocation("placeholder"), new RedistributeThroughputPropertiesResource(ThroughputPolicyType.Custom, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("0") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("1") -{ -Throughput = 5000, -} - }, new PhysicalPartitionThroughputInfoResource[] - { -new PhysicalPartitionThroughputInfoResource("2") -{ -Throughput = 5000, -},new PhysicalPartitionThroughputInfoResource("3") - })); - ArmOperation lro = await mongoDBDatabaseThroughputSetting.MongoDBDatabaseRedistributeThroughputAsync(WaitUntil.Completed, redistributeThroughputParameters); - PhysicalPartitionThroughputInfoResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs index 419545b961ae..e9b6609fbb0d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs index 8e74227a62d8..7d008a2855bd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs index 4a56ca47e34c..a7eb8797ce2f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBMongoDBUserDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoUserDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs index 33ae7a4ab1f4..c1760050e72d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index f2e5f483e08f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationCollection - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationList.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation and iterate over the result - await foreach (NetworkSecurityPerimeterConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NetworkSecurityPerimeterConfigurationResource result = await collection.GetAsync(networkSecurityPerimeterConfigurationName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - bool result = await collection.ExistsAsync(networkSecurityPerimeterConfigurationName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this CosmosDBAccountResource created on azure - // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); - - // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = cosmosDBAccount.GetNetworkSecurityPerimeterConfigurations(); - - // invoke the operation - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - NullableResponse response = await collection.GetIfExistsAsync(networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index 499970937a60..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.CosmosDB.Samples -{ - public partial class Sample_NetworkSecurityPerimeterConfigurationResource - { - // NamspaceNetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationGet.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "cosmosTest"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - NetworkSecurityPerimeterConfigurationResource result = await networkSecurityPerimeterConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NetworkSecurityPerimeterConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // NetworkSecurityPerimeterConfigurationList - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Reconcile_NetworkSecurityPerimeterConfigurationList() - { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json - // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure - // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource - string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; - string resourceGroupName = "res4410"; - string accountName = "sto8607"; - string networkSecurityPerimeterConfigurationName = "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); - - // invoke the operation - await networkSecurityPerimeterConfiguration.ReconcileAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs index 599aada1bad0..904dc73b2279 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RestorableCosmosDBAccountCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_CosmosDBRestorableDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json // this example is just showing the usage of "RestorableDatabaseAccounts_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetAll_CosmosDBRestorableDatabaseAccountList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs index 16b18f528d9c..7eadbd5bce32 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorableCosmosDBAccountResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccountNoLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json // this example is just showing the usage of "RestorableDatabaseAccounts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccoun [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json // this example is just showing the usage of "RestorableSqlDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json // this example is just showing the usage of "RestorableSqlContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableSqlResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json // this example is just showing the usage of "RestorableSqlResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json // this example is just showing the usage of "RestorableMongodbDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -207,7 +207,7 @@ public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json // this example is just showing the usage of "RestorableMongodbCollections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -238,7 +238,7 @@ public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbColle [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableMongodbResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json // this example is just showing the usage of "RestorableMongodbResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -270,7 +270,7 @@ public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbR [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json // this example is just showing the usage of "RestorableGremlinDatabases_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -300,7 +300,7 @@ public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabas [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json // this example is just showing the usage of "RestorableGremlinGraphs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -331,7 +331,7 @@ public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableGremlinResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json // this example is just showing the usage of "RestorableGremlinResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -363,7 +363,7 @@ public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTables_CosmosDBRestorableTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json // this example is just showing the usage of "RestorableTables_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -393,7 +393,7 @@ public async Task GetRestorableTables_CosmosDBRestorableTableList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorableTableResources_CosmosDBRestorableTableResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-05-15-preview/examples/CosmosDBRestorableTableResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json // this example is just showing the usage of "RestorableTableResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index 49fc8fcdd8f2..8c7e36c8a9ee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -10,81 +10,12 @@ using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.CosmosDB.Models { /// Model factory for models. public static partial class ArmCosmosDBModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkSecurityPerimeterConfigurationProperties properties = null) - { - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = null, IEnumerable provisioningIssues = null, NetworkSecurityPerimeter networkSecurityPerimeter = null, ResourceAssociation resourceAssociation = null, NetworkSecurityProfile profile = null) - { - provisioningIssues ??= new List(); - - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues?.ToList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the issue. - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - /// A new instance for mocking. - public static ProvisioningIssue ProvisioningIssue(string name = null, ProvisioningIssueProperties properties = null) - { - return new ProvisioningIssue(name, properties, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// A new instance for mocking. - public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? issueType = null, Severity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) - { - suggestedResourceIds ??= new List(); - suggestedAccessRules ??= new List(); - - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds?.ToList(), - suggestedAccessRules?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -93,6 +24,7 @@ public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. @@ -129,23 +61,16 @@ public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); ipRules ??= new List(); @@ -167,6 +92,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu tags, location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -199,21 +125,14 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -281,26 +200,6 @@ public static CosmosDBPrivateLinkServiceConnectionStateProperty CosmosDBPrivateL return new CosmosDBPrivateLinkServiceConnectionStateProperty(status, description, actionsRequired, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// A new instance for mocking. - public static CapacityModeChangeTransitionState CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus = null, CapacityMode? currentCapacityMode = null, CapacityMode? previousCapacityMode = null, DateTimeOffset? capacityModeTransitionBeginTimestamp = null, DateTimeOffset? capacityModeTransitionEndTimestamp = null, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = null) - { - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. /// The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. @@ -342,21 +241,16 @@ public static DatabaseAccountKeysMetadata DatabaseAccountKeysMetadata(DateTimeOf /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null) + public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -392,18 +286,13 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -444,23 +334,17 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// A new instance for mocking. - public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, bool? enableBurstCapacity = null, string customerManagedKeyStatus = null, bool? enablePerRegionPerPartitionAutoscale = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -478,6 +362,7 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate tags, location, kind, + identity, consistencyPolicy, locations?.ToList(), databaseAccountOfferType, @@ -502,21 +387,15 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate cors?.ToList(), networkAclBypass, networkAclBypassResourceIds?.ToList(), - diagnosticLogEnableFullTextQuery != null ? new DiagnosticLogSettings(diagnosticLogEnableFullTextQuery, serializedAdditionalRawData: null) : null, disableLocalAuth, restoreParameters, capacityTotalThroughputLimit != null ? new CosmosDBAccountCapacity(capacityTotalThroughputLimit, serializedAdditionalRawData: null) : null, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData: null); } @@ -551,15 +430,6 @@ public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(st return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// A new instance for mocking. - public static CosmosDBErrorResult CosmosDBErrorResult(string code = null, string message = null) - { - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The start time for the metric (ISO-8601 format). /// The end time for the metric (ISO-8601 format). @@ -762,62 +632,6 @@ public static CosmosDBMetricAvailability CosmosDBMetricAvailability(string timeG return new CosmosDBMetricAvailability(timeGrain, retention, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultData GraphResourceGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, GraphResourceGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier resourceId = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resourceId != null ? ResourceManagerModelFactory.WritableSubResource(resourceId) : null, - options, - identity, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -827,9 +641,8 @@ public static GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResult /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBSqlDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -842,7 +655,6 @@ public static CosmosDBSqlDatabaseData CosmosDBSqlDatabaseData(ResourceIdentifier location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -879,9 +691,8 @@ public static ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabas /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -894,7 +705,6 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -906,9 +716,8 @@ public static CosmosDBSqlDatabaseCreateOrUpdateContent CosmosDBSqlDatabaseCreate /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -920,7 +729,6 @@ public static ThroughputSettingData ThroughputSettingData(ResourceIdentifier id tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -988,9 +796,8 @@ public static AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int ma /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// A new instance for mocking. - public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ThroughputSettingsResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1002,50 +809,9 @@ public static ThroughputSettingsUpdateData ThroughputSettingsUpdateData(Resource tags, location, resource, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) - { - return new CosmosDBSqlClientEncryptionKeyData( - id, - name, - resourceType, - systemData, - resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the ClientEncryptionKey. - /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. - /// Wrapped (encrypted) form of the key represented as a byte array. - /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CosmosDBSqlClientEncryptionKeyProperties( - id, - encryptionAlgorithm, - wrappedDataEncryptionKey, - keyWrapMetadata, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1055,9 +821,8 @@ public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncrypti /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlContainerResourceInfo resource = null, CosmosDBSqlContainerPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1070,7 +835,6 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1085,13 +849,12 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -1107,7 +870,6 @@ public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContai analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), serializedAdditionalRawData: null, rid, @@ -1128,16 +890,6 @@ public static CosmosDBContainerPartitionKey CosmosDBContainerPartitionKey(IEnume return new CosmosDBContainerPartitionKey(paths?.ToList(), kind, version, isSystemKey, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// A new instance for mocking. - public static MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) - { - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1147,9 +899,8 @@ public static MaterializedViewDefinition MaterializedViewDefinition(string sourc /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlContainerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1162,107 +913,47 @@ public static CosmosDBSqlContainerCreateOrUpdateContent CosmosDBSqlContainerCrea location, resource, options, - identity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfoCollection PhysicalPartitionStorageInfoCollection(IEnumerable physicalPartitionStorageInfoCollectionValue = null) - { - physicalPartitionStorageInfoCollectionValue ??= new List(); - - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollectionValue?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. - /// A new instance for mocking. - public static PhysicalPartitionStorageInfo PhysicalPartitionStorageInfo(string id = null, double? storageInKB = null) - { - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RetrieveThroughputParameters RetrieveThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionIds = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - resourcePhysicalPartitionIds ??= new List(); - - return new RetrieveThroughputParameters( - id, - name, - resourceType, - systemData, - tags, - location, - resourcePhysicalPartitionIds != null ? new RetrieveThroughputPropertiesResource(resourcePhysicalPartitionIds?.ToList(), serializedAdditionalRawData: null) : null, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// A new instance for mocking. - public static PhysicalPartitionThroughputInfoResult PhysicalPartitionThroughputInfoResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resourcePhysicalPartitionThroughputInfo = null, ManagedServiceIdentity identity = null) + /// + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyData CosmosDBSqlClientEncryptionKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBSqlClientEncryptionKeyProperties resource = null) { - tags ??= new Dictionary(); - resourcePhysicalPartitionThroughputInfo ??= new List(); - - return new PhysicalPartitionThroughputInfoResult( + return new CosmosDBSqlClientEncryptionKeyData( id, name, resourceType, systemData, - tags, - location, - resourcePhysicalPartitionThroughputInfo != null ? new PhysicalPartitionThroughputInfoResultPropertiesResource(resourcePhysicalPartitionThroughputInfo?.ToList(), serializedAdditionalRawData: null) : null, - identity, + resource, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// A new instance for mocking. - public static RedistributeThroughputParameters RedistributeThroughputParameters(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RedistributeThroughputPropertiesResource resource = null, ManagedServiceIdentity identity = null) + /// Initializes a new instance of . + /// Name of the ClientEncryptionKey. + /// Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. + /// Wrapped (encrypted) form of the key represented as a byte array. + /// Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. + /// A system generated property. A unique identifier. + /// A system generated property that denotes the last updated timestamp of the resource. + /// A system generated property representing the resource etag required for optimistic concurrency control. + /// A new instance for mocking. + public static CosmosDBSqlClientEncryptionKeyProperties CosmosDBSqlClientEncryptionKeyProperties(string id = null, string encryptionAlgorithm = null, byte[] wrappedDataEncryptionKey = null, CosmosDBKeyWrapMetadata keyWrapMetadata = null, string rid = null, float? timestamp = null, ETag? etag = null) { - tags ??= new Dictionary(); - - return new RedistributeThroughputParameters( + return new CosmosDBSqlClientEncryptionKeyProperties( id, - name, - resourceType, - systemData, - tags, - location, - resource, - identity, - serializedAdditionalRawData: null); + encryptionAlgorithm, + wrappedDataEncryptionKey, + keyWrapMetadata, + serializedAdditionalRawData: null, + rid, + timestamp, + etag); } /// Initializes a new instance of . @@ -1273,9 +964,8 @@ public static RedistributeThroughputParameters RedistributeThroughputParameters( /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1287,7 +977,6 @@ public static CosmosDBSqlStoredProcedureData CosmosDBSqlStoredProcedureData(Reso tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1318,9 +1007,8 @@ public static ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSql /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlStoredProcedureResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1333,7 +1021,6 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1345,9 +1032,8 @@ public static CosmosDBSqlStoredProcedureCreateOrUpdateContent CosmosDBSqlStoredP /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1359,7 +1045,6 @@ public static CosmosDBSqlUserDefinedFunctionData CosmosDBSqlUserDefinedFunctionD tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1390,9 +1075,8 @@ public static ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo ExtendedCosmosD /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlUserDefinedFunctionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1405,7 +1089,6 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1417,9 +1100,8 @@ public static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent CosmosDBSqlUse /// The tags. /// The location. /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCosmosDBSqlTriggerResourceInfo resource = null) { tags ??= new Dictionary(); @@ -1431,7 +1113,6 @@ public static CosmosDBSqlTriggerData CosmosDBSqlTriggerData(ResourceIdentifier i tags, location, resource, - identity, serializedAdditionalRawData: null); } @@ -1466,9 +1147,8 @@ public static ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerR /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBSqlTriggerResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1481,7 +1161,6 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1494,9 +1173,8 @@ public static CosmosDBSqlTriggerCreateOrUpdateContent CosmosDBSqlTriggerCreateOr /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBDatabaseResourceInfo resource = null, MongoDBDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1509,7 +1187,6 @@ public static MongoDBDatabaseData MongoDBDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1542,9 +1219,8 @@ public static ExtendedMongoDBDatabaseResourceInfo ExtendedMongoDBDatabaseResourc /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1557,7 +1233,6 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1570,9 +1245,8 @@ public static MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedMongoDBCollectionResourceInfo resource = null, MongoDBCollectionPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1585,7 +1259,6 @@ public static MongoDBCollectionData MongoDBCollectionData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1627,9 +1300,8 @@ public static ExtendedMongoDBCollectionResourceInfo ExtendedMongoDBCollectionRes /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MongoDBCollectionResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1642,7 +1314,6 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1655,9 +1326,8 @@ public static MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTablePropertiesResource resource = null, CosmosDBTablePropertiesOptions options = null) { tags ??= new Dictionary(); @@ -1670,7 +1340,6 @@ public static CosmosDBTableData CosmosDBTableData(ResourceIdentifier id = null, location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1703,9 +1372,8 @@ public static CosmosDBTablePropertiesResource CosmosDBTablePropertiesResource(st /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1718,7 +1386,6 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1731,9 +1398,8 @@ public static CosmosDBTableCreateOrUpdateContent CosmosDBTableCreateOrUpdateCont /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraKeyspaceResourceInfo resource = null, CassandraKeyspacePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1746,7 +1412,6 @@ public static CassandraKeyspaceData CassandraKeyspaceData(ResourceIdentifier id location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1770,9 +1435,8 @@ public static ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceRes /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string resourceKeyspaceName = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1785,7 +1449,6 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp location, resourceKeyspaceName != null ? new CassandraKeyspaceResourceInfo(resourceKeyspaceName, serializedAdditionalRawData: null) : null, options, - identity, serializedAdditionalRawData: null); } @@ -1798,9 +1461,8 @@ public static CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUp /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableData CassandraTableData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedCassandraTableResourceInfo resource = null, CassandraTablePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1813,7 +1475,6 @@ public static CassandraTableData CassandraTableData(ResourceIdentifier id = null location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1848,9 +1509,8 @@ public static ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceI /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraTableResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1863,7 +1523,6 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1876,9 +1535,8 @@ public static CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateCo /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinDatabaseResourceInfo resource = null, GremlinDatabasePropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1891,7 +1549,6 @@ public static GremlinDatabaseData GremlinDatabaseData(ResourceIdentifier id = nu location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1924,9 +1581,8 @@ public static ExtendedGremlinDatabaseResourceInfo ExtendedGremlinDatabaseResourc /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinDatabaseResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -1939,7 +1595,6 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -1952,9 +1607,8 @@ public static GremlinDatabaseCreateOrUpdateContent GremlinDatabaseCreateOrUpdate /// The location. /// /// - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedGremlinGraphResourceInfo resource = null, GremlinGraphPropertiesConfig options = null) { tags ??= new Dictionary(); @@ -1967,7 +1621,6 @@ public static GremlinGraphData GremlinGraphData(ResourceIdentifier id = null, st location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2014,9 +1667,8 @@ public static ExtendedGremlinGraphResourceInfo ExtendedGremlinGraphResourceInfo( /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// A new instance for mocking. - public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) + public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GremlinGraphResourceInfo resource = null, CosmosDBCreateUpdateConfig options = null) { tags ??= new Dictionary(); @@ -2029,7 +1681,6 @@ public static GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateConten location, resource, options, - identity, serializedAdditionalRawData: null); } @@ -2073,182 +1724,6 @@ public static CosmosDBLocationProperties CosmosDBLocationProperties(bool? doesSu serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultData CassandraViewGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewGetPropertiesResource resource = null, CassandraViewGetPropertiesOptions options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultData( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - /// A new instance for mocking. - public static CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = null, ETag? etag = null) - { - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData: null, - rid, - timestamp, - etag); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// A new instance for mocking. - public static CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CassandraViewResource resource = null, CosmosDBCreateUpdateConfig options = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - options, - identity, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// A new instance for mocking. - public static DataTransferJobGetResultCreateOrUpdateContent DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataTransferJobProperties properties = null) - { - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobProperties DataTransferJobProperties(string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// A new instance for mocking. - public static DataTransferJobGetResultData DataTransferJobGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string jobName = null, DataTransferDataSourceSink source = null, DataTransferDataSourceSink destination = null, string status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, DataTransferJobMode? mode = null) - { - return new DataTransferJobGetResultData( - id, - name, - resourceType, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcOn, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2285,34 +1760,25 @@ public static CassandraClusterData CassandraClusterData(ResourceIdentifier id = /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// A new instance for mocking. - public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, CassandraAutoReplicateForm? autoReplicate = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, IEnumerable externalDataCenters = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraClusterType? clusterType = null, CassandraError provisionError = null, IEnumerable extensions = null, IEnumerable backupSchedules = null, ScheduledEventStrategy? scheduledEventStrategy = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) + public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraError provisionError = null, ServiceConnectionType? azureConnectionMethod = null, ResourceIdentifier privateLinkResourceId = null) { clientCertificates ??= new List(); externalGossipCertificates ??= new List(); gossipCertificates ??= new List(); externalSeedNodes ??= new List(); seedNodes ??= new List(); - externalDataCenters ??= new List(); - extensions ??= new List(); - backupSchedules ??= new List(); return new CassandraClusterProperties( provisioningState, @@ -2324,21 +1790,15 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro initialCassandraAdminPassword, prometheusEndpointIPAddress != null ? new CassandraDataCenterSeedNode(prometheusEndpointIPAddress, serializedAdditionalRawData: null) : null, isRepairEnabled, - autoReplicate, clientCertificates?.ToList(), externalGossipCertificates?.ToList(), gossipCertificates?.ToList(), externalSeedNodes?.ToList(), seedNodes?.ToList(), - externalDataCenters?.ToList(), hoursBetweenBackups, isDeallocated, isCassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions?.ToList(), - backupSchedules?.ToList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData: null); @@ -2349,9 +1809,9 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// A new instance for mocking. - public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? allowWrite = null) + public static CassandraCommandPostBody CassandraCommandPostBody(string command = null, IDictionary arguments = null, string host = null, bool? cassandraStopStart = null, bool? readwrite = null) { arguments ??= new Dictionary(); @@ -2360,7 +1820,7 @@ public static CassandraCommandPostBody CassandraCommandPostBody(string command = arguments, host, cassandraStopStart, - allowWrite, + readwrite, serializedAdditionalRawData: null); } @@ -2372,52 +1832,6 @@ public static CassandraCommandOutput CassandraCommandOutput(string commandOutput return new CassandraCommandOutput(commandOutput, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// A new instance for mocking. - public static CassandraClusterCommand CassandraClusterCommand(string command = null, string commandId = null, BinaryData arguments = null, string host = null, bool? isAdmin = null, bool? shouldStopCassandraBeforeStart = null, bool? isReadWrite = null, string result = null, CassandraClusterCommandStatus? status = null, string outputFile = null) - { - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - shouldStopCassandraBeforeStart, - isReadWrite, - result, - status, - outputFile, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// A new instance for mocking. - public static CassandraClusterBackupResourceInfo CassandraClusterBackupResourceInfo(string backupId = null, CassandraClusterBackupState? backupState = null, DateTimeOffset? backupStartTimestamp = null, DateTimeOffset? backupStopTimestamp = null, DateTimeOffset? backupExpiryTimestamp = null) - { - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -2562,9 +1976,8 @@ public static CassandraClusterPublicStatusDataCentersItem CassandraClusterPublic /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// A new instance for mocking. - public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null, bool? isLatestModel = null) + public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null) { tokens ??= new List(); @@ -2586,7 +1999,6 @@ public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeI memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData: null); } @@ -2731,12 +2143,12 @@ public static CosmosDBSqlRoleAssignmentData CosmosDBSqlRoleAssignmentData(Resour /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// A new instance for mocking. - public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? oldestRestorableOn = null, DateTimeOffset? deletedOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) + public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string accountName = null, DateTimeOffset? createdOn = null, DateTimeOffset? deletedOn = null, DateTimeOffset? oldestRestorableOn = null, CosmosDBApiType? apiType = null, IEnumerable restorableLocations = null) { restorableLocations ??= new List(); @@ -2748,8 +2160,8 @@ public static RestorableCosmosDBAccountData RestorableCosmosDBAccountData(Resour location, accountName, createdOn, - oldestRestorableOn, deletedOn, + oldestRestorableOn, apiType, restorableLocations?.ToList(), serializedAdditionalRawData: null); @@ -2895,14 +2307,13 @@ public static ExtendedRestorableSqlContainerResourceInfo ExtendedRestorableSqlCo /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, IEnumerable computedProperties = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); computedProperties ??= new List(); @@ -2918,7 +2329,6 @@ public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlCon analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties?.ToList(), serializedAdditionalRawData: null, self, @@ -3246,56 +2656,6 @@ public static CosmosDBServiceProperties CosmosDBServiceProperties(DateTimeOffset additionalProperties); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolData CosmosDBThroughputPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBStatus? provisioningState = null, int? maxThroughput = null) - { - tags ??= new Dictionary(); - - return new CosmosDBThroughputPoolData( - id, - name, - resourceType, - systemData, - tags, - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// A new instance for mocking. - public static CosmosDBThroughputPoolAccountData CosmosDBThroughputPoolAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, ResourceIdentifier accountResourceIdentifier = null, AzureLocation? accountLocation = null, string accountInstanceId = null) - { - return new CosmosDBThroughputPoolAccountData( - id, - name, - resourceType, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// Time of the last state change (ISO-8601 format). /// Instance type for the service. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs index 1dc439410cac..cd82e4e96b7f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string cl /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs index 6e46d7671878..d5e96acdffb3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs @@ -10,7 +10,6 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.CosmosDB.Models; @@ -111,7 +110,7 @@ public virtual CassandraDataCenterCollection GetCassandraDataCenters() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +141,7 @@ public virtual async Task> GetCassandraDat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -173,7 +172,7 @@ public virtual Response GetCassandraDataCenter(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -213,7 +212,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +252,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -295,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -337,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -383,7 +382,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -429,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -475,7 +474,7 @@ public virtual async Task> InvokeCommandAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -508,362 +507,6 @@ public virtual ArmOperation InvokeCommand(WaitUntil wait } } - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// List all commands currently running on ring info - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands - /// - /// - /// Operation Id - /// CassandraClusters_ListCommand - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommand(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListCommandRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommand", "value", null, cancellationToken); - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCommandAsyncAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "value", null, cancellationToken); - } - - /// - /// Get details about a specified command that was run asynchronously. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId} - /// - /// - /// Operation Id - /// CassandraClusters_GetCommandAsync - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCommandAsync(string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateGetCommandAsyncRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, commandId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterCommand.DeserializeCassandraClusterCommand(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetCommandAsync", "value", null, cancellationToken); - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBackupsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// List the backups of this cluster that are available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups - /// - /// - /// Operation Id - /// CassandraClusters_ListBackups - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBackups(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraClusterRestClient.CreateListBackupsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(e), _cassandraClusterClientDiagnostics, Pipeline, "CassandraClusterResource.GetBackups", "value", null, cancellationToken); - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetBackupAsync(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.GetBackupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get the properties of an individual backup of this cluster that is available to restore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId} - /// - /// - /// Operation Id - /// CassandraClusters_GetBackup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Id of a restorable backup of a Cassandra cluster. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetBackup(string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.GetBackup"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.GetBackup(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, backupId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual async Task DeallocateAsync(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = await _cassandraClusterRestClient.DeallocateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate - /// - /// - /// Operation Id - /// CassandraClusters_Deallocate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. - /// The cancellation token to use. - public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) - { - using var scope = _cassandraClusterClientDiagnostics.CreateScope("CassandraClusterResource.Deallocate"); - scope.Start(); - try - { - var response = _cassandraClusterRestClient.Deallocate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraClusterClientDiagnostics, Pipeline, _cassandraClusterRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, xMsForceDeallocate).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. /// @@ -877,7 +520,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeall /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -919,7 +562,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -961,7 +604,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -999,7 +642,7 @@ public virtual async Task> StatusAsync(Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1037,7 +680,7 @@ public virtual Response Status(CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1099,7 +742,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1161,7 +804,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1218,7 +861,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1275,7 +918,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1335,7 +978,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs index b34f9319bcb5..da33d48885ad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataCenterName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string dataCenterName, Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string dataCenterName, CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs index c9fb24fa3904..80a9cf76b71f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs index e8cbf8281f80..9e6908848a59 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyspaceName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string keyspaceName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string keyspaceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs index 074a6a239663..7be636935e2f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CassandraKeyspaceData DeserializeCassandraKeyspaceData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs index 4645ff58529a..6a387d2c9ab5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.cs @@ -66,13 +66,11 @@ public CassandraKeyspaceData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraKeyspaceResourceInfo resource, CassandraKeyspacePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraKeyspaceData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraKeyspacePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs index 89980d5d5e36..ddb606449336 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs @@ -117,7 +117,7 @@ public virtual CassandraTableCollection GetCassandraTables() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetCassandraTableAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -166,75 +166,6 @@ public virtual Response GetCassandraTable(string tableNa return GetCassandraTables().Get(tableName, cancellationToken); } - /// Gets a collection of CassandraViewGetResultResources in the CassandraKeyspace. - /// An object representing collection of CassandraViewGetResultResources and their operations over a CassandraViewGetResultResource. - public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() - { - return GetCachedClient(client => new CassandraViewGetResultCollection(client, Id)); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCassandraViewGetResultAsync(string viewName, CancellationToken cancellationToken = default) - { - return await GetCassandraViewGetResults().GetAsync(viewName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCassandraViewGetResult(string viewName, CancellationToken cancellationToken = default) - { - return GetCassandraViewGetResults().Get(viewName, cancellationToken); - } - /// /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. /// @@ -248,7 +179,7 @@ public virtual Response GetCassandraViewGetResul /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -288,7 +219,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -328,7 +259,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -370,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +389,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -504,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -566,7 +497,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -628,7 +559,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -685,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -802,7 +733,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs index 3e0bf3005851..92671f9fa1ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs index 139bd0f41ee0..027ca1ef001d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string tabl /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs index 98274578431d..378928df2292 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CassandraTableData DeserializeCassandraTableData(JsonElement ele location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs index 1dc8fd135507..efa48515ddcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.cs @@ -66,13 +66,11 @@ public CassandraTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCassandraTableResourceInfo resource, CassandraTablePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CassandraTableData() /// Gets or sets the options. [WirePath("properties.options")] public CassandraTablePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs index 73dfd2052086..db36342d2361 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs @@ -111,7 +111,7 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs index 91c9aec778be..33413b2d5be9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs deleted file mode 100644 index 2e74d51cfc8c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCassandraViewGetResults method from an instance of . - /// - public partial class CassandraViewGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CassandraViewGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraViewGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CassandraViewGetResultResource.ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CassandraKeyspaceResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CassandraKeyspaceResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB view name. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views - /// - /// - /// Operation Id - /// CassandraResources_ListCassandraViews - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraViewGetResultCassandraResourcesRestClient.CreateListCassandraViewsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraViewGetResultResource(Client, CassandraViewGetResultData.DeserializeCassandraViewGetResultData(e)), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, "CassandraViewGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB view name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, viewName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs deleted file mode 100644 index dda3d0de1eb7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs +++ /dev/null @@ -1,436 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - - internal static CassandraViewGetResultData DeserializeCassandraViewGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewGetPropertiesResource resource = default; - CassandraViewGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = CassandraViewGetPropertiesResource.DeserializeCassandraViewGetPropertiesResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CassandraViewGetPropertiesOptions.DeserializeCassandraViewGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs deleted file mode 100644 index 2539d5967ab1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CassandraViewGetResult data model. - /// An Azure Cosmos DB Cassandra view. - /// - public partial class CassandraViewGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CassandraViewGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewGetPropertiesResource resource, CassandraViewGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultData() - { - } - - /// Gets or sets the resource. - [WirePath("properties.resource")] - public CassandraViewGetPropertiesResource Resource { get; set; } - /// Gets or sets the options. - [WirePath("properties.options")] - public CassandraViewGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs deleted file mode 100644 index e59269939c0f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CassandraViewGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs deleted file mode 100644 index 0927acabac60..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewGetResult method. - /// - public partial class CassandraViewGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewGetResultCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewGetResultCassandraResourcesRestClient; - private readonly CassandraViewGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, CassandraViewGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewGetResultCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewGetResultCassandraResourcesApiVersion); - _cassandraViewGetResultCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewGetResultCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CassandraViewGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets an object representing a CassandraViewThroughputSettingResource along with the instance operations that can be performed on it in the CassandraViewGetResult. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSetting() - { - return new CassandraViewThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_DeleteCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Delete"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.DeleteCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateDeleteCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = await _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Cassandra View - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_CreateUpdateCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Cassandra View. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.Update"); - scope.Start(); - try - { - var response = _cassandraViewGetResultCassandraResourcesRestClient.CreateUpdateCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewGetResultOperationSource(Client), _cassandraViewGetResultCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewGetResultCassandraResourcesRestClient.CreateCreateUpdateCassandraViewRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraViewAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName} - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraView - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewGetResultCassandraResourcesClientDiagnostics.CreateScope("CassandraViewGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewGetResultCassandraResourcesRestClient.GetCassandraView(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new CassandraViewGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CassandraViewGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs deleted file mode 100644 index 2475f83486ec..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CassandraViewThroughputSettingResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ThroughputSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ThroughputSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs deleted file mode 100644 index 70d024fa4e59..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs +++ /dev/null @@ -1,792 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CassandraViewThroughputSetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCassandraViewThroughputSettingResource method. - /// Otherwise you can get one from its parent resource using the GetCassandraViewThroughputSetting method. - /// - public partial class CassandraViewThroughputSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The keyspaceName. - /// The viewName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics; - private readonly CassandraResourcesRestOperations _cassandraViewThroughputSettingCassandraResourcesRestClient; - private readonly ThroughputSettingData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/views/throughputSettings"; - - /// Initializes a new instance of the class for mocking. - protected CassandraViewThroughputSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ThroughputSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CassandraViewThroughputSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cassandraViewThroughputSettingCassandraResourcesApiVersion); - _cassandraViewThroughputSettingCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraViewThroughputSettingCassandraResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ThroughputSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - 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. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.Get"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update RUs per second of an Azure Cosmos DB Cassandra view - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_UpdateCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The RUs per second of the parameters to provide for the current Cassandra view. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.UpdateCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateUpdateCassandraViewThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToAutoscaleAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscaleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToAutoscale - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToAutoscale(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToAutoscale"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToAutoscale(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToAutoscaleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> MigrateCassandraViewToManualThroughputAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = await _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput - /// - /// - /// Operation Id - /// CassandraResources_MigrateCassandraViewToManualThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation MigrateCassandraViewToManualThroughput(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.MigrateCassandraViewToManualThroughput"); - scope.Start(); - try - { - var response = _cassandraViewThroughputSettingCassandraResourcesRestClient.MigrateCassandraViewToManualThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - var operation = new CosmosDBArmOperation(new CassandraViewThroughputSettingOperationSource(Client), _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics, Pipeline, _cassandraViewThroughputSettingCassandraResourcesRestClient.CreateMigrateCassandraViewToManualThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await CreateOrUpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default - /// - /// - /// Operation Id - /// CassandraResources_GetCassandraViewThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _cassandraViewThroughputSettingCassandraResourcesClientDiagnostics.CreateScope("CassandraViewThroughputSettingResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cassandraViewThroughputSettingCassandraResourcesRestClient.GetCassandraViewThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); - return Response.FromValue(new CassandraViewThroughputSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ThroughputSettingsUpdateData(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = CreateOrUpdate(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs index 7b91d45efe57..76c4fae61205 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string acc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string accountName, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs index 0a489937adec..0f4188a6750d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs @@ -291,11 +291,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -306,21 +301,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - writer.WritePropertyName("capacityModeChangeTransitionState"u8); - writer.WriteObjectValue(CapacityModeChangeTransitionState, options); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -331,31 +311,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -440,19 +410,13 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - CapacityModeChangeTransitionState capacityModeChangeTransitionState = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -862,15 +826,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -889,33 +844,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("capacityModeChangeTransitionState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeChangeTransitionState = CapacityModeChangeTransitionState.DeserializeCapacityModeChangeTransitionState(property0.Value, options); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -934,15 +862,6 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -952,27 +871,18 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -1001,6 +911,7 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e tags ?? new ChangeTrackingDictionary(), location, kind, + identity, provisioningState, documentEndpoint, databaseAccountOfferType, @@ -1033,21 +944,14 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - capacityModeChangeTransitionState, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1802,26 +1706,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1858,52 +1742,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeChangeTransitionState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeChangeTransitionState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeChangeTransitionState)) - { - builder.Append(" capacityModeChangeTransitionState: "); - BicepSerializationHelpers.AppendChildObject(builder, CapacityModeChangeTransitionState, options, 4, false, " capacityModeChangeTransitionState: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1935,34 +1773,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1989,37 +1827,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs index 32202f3b3d50..0e8a7ba8458e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs @@ -75,6 +75,7 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. /// The connection endpoint for the Cosmos DB database account. /// The offer type for the Cosmos DB database account. Default value: Standard. @@ -111,25 +112,19 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// The object that represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, CapacityModeChangeTransitionState capacityModeChangeTransitionState, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ProvisioningState = provisioningState; DocumentEndpoint = documentEndpoint; DatabaseAccountOfferType = databaseAccountOfferType; @@ -162,21 +157,14 @@ internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType re Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - CapacityModeChangeTransitionState = capacityModeChangeTransitionState; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -188,6 +176,9 @@ internal CosmosDBAccountData() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } /// The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. [WirePath("properties.provisioningState")] public string ProvisioningState { get; } @@ -256,7 +247,7 @@ internal CosmosDBAccountData() public bool? IsFreeTierEnabled { get; set; } /// API specific properties. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -312,21 +303,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -345,41 +321,23 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// The object that represents the migration state for the CapacityMode of the Cosmos DB account. - [WirePath("properties.capacityModeChangeTransitionState")] - public CapacityModeChangeTransitionState CapacityModeChangeTransitionState { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// The object that represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs index 0eeb0ea12624..9be4ca15b5b1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -135,144 +135,6 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the CosmosDBAccount. - /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. - public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() - { - return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); - } - - /// Gets a collection of GraphResourceGetResultResources in the CosmosDBAccount. - /// An object representing collection of GraphResourceGetResultResources and their operations over a GraphResourceGetResultResource. - public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() - { - return GetCachedClient(client => new GraphResourceGetResultCollection(client, Id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetGraphResourceGetResultAsync(string graphName, CancellationToken cancellationToken = default) - { - return await GetGraphResourceGetResults().GetAsync(graphName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetGraphResourceGetResult(string graphName, CancellationToken cancellationToken = default) - { - return GetGraphResourceGetResults().Get(graphName, cancellationToken); - } - /// Gets a collection of CosmosDBSqlDatabaseResources in the CosmosDBAccount. /// An object representing collection of CosmosDBSqlDatabaseResources and their operations over a CosmosDBSqlDatabaseResource. public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() @@ -293,7 +155,7 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -324,7 +186,7 @@ public virtual async Task> GetCosmosDBSqlD /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -362,7 +224,7 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -393,7 +255,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -431,7 +293,7 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -462,7 +324,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -500,7 +362,7 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -531,7 +393,7 @@ public virtual async Task> GetMongoDBDatabaseA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -569,7 +431,7 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -600,7 +462,7 @@ public virtual async Task> GetMongoDBRol /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -638,7 +500,7 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -669,7 +531,7 @@ public virtual async Task> GetMongoDBUse /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -707,7 +569,7 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -738,7 +600,7 @@ public virtual async Task> GetCosmosDBTableAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -776,7 +638,7 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -807,7 +669,7 @@ public virtual async Task> GetCassandraKeysp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -845,7 +707,7 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -876,7 +738,7 @@ public virtual async Task> GetGremlinDatabaseA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -894,75 +756,6 @@ public virtual Response GetGremlinDatabase(string datab return GetGremlinDatabases().Get(databaseName, cancellationToken); } - /// Gets a collection of DataTransferJobGetResultResources in the CosmosDBAccount. - /// An object representing collection of DataTransferJobGetResultResources and their operations over a DataTransferJobGetResultResource. - public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() - { - return GetCachedClient(client => new DataTransferJobGetResultCollection(client, Id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetDataTransferJobGetResultAsync(string jobName, CancellationToken cancellationToken = default) - { - return await GetDataTransferJobGetResults().GetAsync(jobName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetDataTransferJobGetResult(string jobName, CancellationToken cancellationToken = default) - { - return GetDataTransferJobGetResults().Get(jobName, cancellationToken); - } - /// Gets a collection of CosmosDBPrivateEndpointConnectionResources in the CosmosDBAccount. /// An object representing collection of CosmosDBPrivateEndpointConnectionResources and their operations over a CosmosDBPrivateEndpointConnectionResource. public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEndpointConnections() @@ -983,7 +776,7 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1014,7 +807,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1052,7 +845,7 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1083,7 +876,7 @@ public virtual async Task> GetCosmosDBPriv /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1121,7 +914,7 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1152,7 +945,7 @@ public virtual async Task> GetCosmosDBServiceA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1183,7 +976,7 @@ public virtual Response GetCosmosDBService(string servi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1223,7 +1016,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1263,7 +1056,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1305,7 +1098,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1347,7 +1140,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1393,7 +1186,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1439,7 +1232,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1485,7 +1278,7 @@ public virtual async Task FailoverPriorityChangeAsync(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1531,7 +1324,7 @@ public virtual ArmOperation FailoverPriorityChange(WaitUntil waitUntil, CosmosDB /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1569,7 +1362,7 @@ public virtual async Task> GetKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1607,7 +1400,7 @@ public virtual Response GetKeys(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1636,7 +1429,7 @@ public virtual AsyncPageable GetConnectionStrin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1665,7 +1458,7 @@ public virtual Pageable GetConnectionStrings(Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1711,7 +1504,7 @@ public virtual async Task OfflineRegionAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1757,7 +1550,7 @@ public virtual ArmOperation OfflineRegion(WaitUntil waitUntil, RegionForOnlineOf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1803,7 +1596,7 @@ public virtual async Task OnlineRegionAsync(WaitUntil waitUntil, R /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1849,7 +1642,7 @@ public virtual ArmOperation OnlineRegion(WaitUntil waitUntil, RegionForOnlineOff /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1887,7 +1680,7 @@ public virtual async Task> GetReadOnlyK /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1925,7 +1718,7 @@ public virtual Response GetReadOnlyKeys(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1971,7 +1764,7 @@ public virtual async Task RegenerateKeyAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2017,7 +1810,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, CosmosDBAccountRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2050,7 +1843,7 @@ public virtual AsyncPageable GetMetricsAsync(string filter, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2083,7 +1876,7 @@ public virtual Pageable GetMetrics(string filter, Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2113,7 +1906,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = n /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2143,7 +1936,7 @@ public virtual Pageable GetUsages(string filter = null, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2172,7 +1965,7 @@ public virtual AsyncPageable GetMetricDefinitionsAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -2201,7 +1994,7 @@ public virtual Pageable GetMetricDefinitions(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2233,7 +2026,7 @@ public virtual AsyncPageable GetMetricsDatabasesAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2265,7 +2058,7 @@ public virtual Pageable GetMetricsDatabases(string databaseR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2296,7 +2089,7 @@ public virtual AsyncPageable GetUsagesDatabasesAsync(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2327,7 +2120,7 @@ public virtual Pageable GetUsagesDatabases(string databaseRid /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2357,7 +2150,7 @@ public virtual AsyncPageable GetMetricDefinitionsDatab /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2387,7 +2180,7 @@ public virtual Pageable GetMetricDefinitionsDatabases( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2421,7 +2214,7 @@ public virtual AsyncPageable GetMetricsCollectionsAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2455,7 +2248,7 @@ public virtual Pageable GetMetricsCollections(string databas /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2488,7 +2281,7 @@ public virtual AsyncPageable GetUsagesCollectionsAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2521,7 +2314,7 @@ public virtual Pageable GetUsagesCollections(string databaseR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2553,7 +2346,7 @@ public virtual AsyncPageable GetMetricDefinitionsColle /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2585,7 +2378,7 @@ public virtual Pageable GetMetricDefinitionsCollection /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2621,7 +2414,7 @@ public virtual AsyncPageable GetMetricsCollectionRegionsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2657,7 +2450,7 @@ public virtual Pageable GetMetricsCollectionRegions(string r /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2689,7 +2482,7 @@ public virtual AsyncPageable GetMetricsDatabaseAccountRegion /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2721,7 +2514,7 @@ public virtual Pageable GetMetricsDatabaseAccountRegions(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2755,7 +2548,7 @@ public virtual AsyncPageable GetMetricsPercentileSourc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2789,7 +2582,7 @@ public virtual Pageable GetMetricsPercentileSourceTarg /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2821,7 +2614,7 @@ public virtual AsyncPageable GetMetricsPercentileTarge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2853,7 +2646,7 @@ public virtual Pageable GetMetricsPercentileTargets(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2882,7 +2675,7 @@ public virtual AsyncPageable GetMetricsPercentilesAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2911,7 +2704,7 @@ public virtual Pageable GetMetricsPercentiles(string f /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2947,7 +2740,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionRegio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -2983,7 +2776,7 @@ public virtual Pageable GetMetricsCollectionPartitionRegions(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3017,7 +2810,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3051,7 +2844,7 @@ public virtual Pageable GetMetricsCollectionPartitions(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3084,7 +2877,7 @@ public virtual AsyncPageable GetUsagesCollectionPartitionsAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3117,7 +2910,7 @@ public virtual Pageable GetUsagesCollectionPartitions(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3153,7 +2946,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdsAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3189,7 +2982,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIds(string d /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3227,7 +3020,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdRegio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -3265,7 +3058,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIdRegions(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -3327,7 +3120,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -3389,7 +3182,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -3446,7 +3239,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -3503,7 +3296,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -3563,7 +3356,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs index 5134e20a5f3e..1e879e0d1160 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetAsync(AzureLoca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual Response Get(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual Response Exists(AzureLocation location, CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index d20b05df8091..7a58ed36b264 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -107,7 +107,7 @@ public virtual RestorableCosmosDBAccountCollection GetRestorableCosmosDBAccounts /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -136,7 +136,7 @@ public virtual async Task> GetRestor /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual Response GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs index 0148e3a30cf3..1550b2b4269f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs index c73ca2061079..e8e8270ab0ee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs index 596b9dc3254d..3e2ad1b6f4cd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs index b35a0e50ba24..2f0578fa83c4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs index 580eb002ea08..5acc5e0bb379 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string ser /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string serviceName, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs index 8fd6f16cc5bf..bbe02533f41f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs index 552987336f4c..d438c22b77d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clien /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clientEncryptionKeyName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs index 5844786a90ed..2c9f0910eda9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs index 2e3a36e86027..fba5e018cf65 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string containerName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string containerName, CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs index 9b42f5b0caed..b1ad773ef7bb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBSqlContainerData DeserializeCosmosDBSqlContainerData(Jso location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs index 25491f81dcb4..e10bf6bc3d9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlContainerData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlContainerResourceInfo resource, CosmosDBSqlContainerPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlContainerData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlContainerPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs index 8d29594a34f1..b5a4a730867b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs @@ -118,7 +118,7 @@ public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedur /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -149,7 +149,7 @@ public virtual async Task> GetCosmo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetCosmosDBSqlTr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Response GetCosmosDBSqlTrigger(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -440,7 +440,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -561,98 +561,6 @@ public virtual ArmOperation Update(WaitUntil waitU } } - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetSqlContainerPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL Container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_ListSqlContainerPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetSqlContainerPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlContainerSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerResource.GetSqlContainerPartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerSqlResourcesRestClient.ListSqlContainerPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlContainerSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerSqlResourcesRestClient.CreateListSqlContainerPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a container resource. /// @@ -666,7 +574,7 @@ public virtual ArmOperation GetSqlContai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -712,7 +620,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -758,7 +666,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -820,7 +728,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -882,7 +790,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -939,7 +847,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -996,7 +904,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1056,7 +964,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs index 5ef1c88920b9..8db762efe0ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -431,190 +431,6 @@ public virtual ArmOperation Migra } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlContainerThroughputSettingResource.SqlContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.SqlContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlContainerThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlContainerThroughputSettingSqlResourcesRestClient.CreateSqlContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -628,7 +444,7 @@ public virtual ArmOperation SqlContainerR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(I /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs index b7e8897cade6..d494fb39272a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs index db802a7149d8..eb81ad5793b0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBSqlDatabaseData DeserializeCosmosDBSqlDatabaseData(JsonE location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs index b4475cc9243d..ba0ffb8b0c4c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.cs @@ -66,13 +66,11 @@ public CosmosDBSqlDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlDatabaseResourceInfo resource, CosmosDBSqlDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBSqlDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBSqlDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index ca801f3677f3..4ea2f08d6cd2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -97,142 +97,142 @@ public virtual CosmosDBSqlDatabaseThroughputSettingResource GetCosmosDBSqlDataba return new CosmosDBSqlDatabaseThroughputSettingResource(Client, Id.AppendChildResource("throughputSettings", "default")); } - /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. - public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() + /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. + public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() { - return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} /// /// /// Operation Id - /// SqlResources_GetClientEncryptionKey + /// SqlResources_GetSqlContainer /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB ClientEncryptionKey name. + /// Cosmos DB container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); + return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); } - /// Gets a collection of CosmosDBSqlContainerResources in the CosmosDBSqlDatabase. - /// An object representing collection of CosmosDBSqlContainerResources and their operations over a CosmosDBSqlContainerResource. - public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() + /// Gets a collection of CosmosDBSqlClientEncryptionKeyResources in the CosmosDBSqlDatabase. + /// An object representing collection of CosmosDBSqlClientEncryptionKeyResources and their operations over a CosmosDBSqlClientEncryptionKeyResource. + public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncryptionKeys() { - return GetCachedClient(client => new CosmosDBSqlContainerCollection(client, Id)); + return GetCachedClient(client => new CosmosDBSqlClientEncryptionKeyCollection(client, Id)); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetCosmosDBSqlContainerAsync(string containerName, CancellationToken cancellationToken = default) + public virtual async Task> GetCosmosDBSqlClientEncryptionKeyAsync(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return await GetCosmosDBSqlContainers().GetAsync(containerName, cancellationToken).ConfigureAwait(false); + return await GetCosmosDBSqlClientEncryptionKeys().GetAsync(clientEncryptionKeyName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName} /// /// /// Operation Id - /// SqlResources_GetSqlContainer + /// SqlResources_GetClientEncryptionKey /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource - /// + /// /// /// /// - /// Cosmos DB container name. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetCosmosDBSqlContainer(string containerName, CancellationToken cancellationToken = default) + public virtual Response GetCosmosDBSqlClientEncryptionKey(string clientEncryptionKeyName, CancellationToken cancellationToken = default) { - return GetCosmosDBSqlContainers().Get(containerName, cancellationToken); + return GetCosmosDBSqlClientEncryptionKeys().Get(clientEncryptionKeyName, cancellationToken); } /// @@ -248,7 +248,7 @@ public virtual Response GetCosmosDBSqlContainer(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -491,98 +491,6 @@ public virtual ArmOperation Update(WaitUntil waitUn } } - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// SqlResources_SqlDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -596,7 +504,7 @@ public virtual ArmOperation SqlDatabaseP /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -658,7 +566,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -720,7 +628,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -777,7 +685,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -834,7 +742,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -894,7 +802,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs index ae5409899328..1596123b5276 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation Migrat } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual async Task> SqlDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB SQL database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// SqlResources_SqlDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current SQL database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation SqlDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseThroughputSettingResource.SqlDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.SqlDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _cosmosDBSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseThroughputSettingSqlResourcesRestClient.CreateSqlDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation SqlDatabaseRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(str /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(ID /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs index ad0e86af8f30..b1a40ba7707c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleAssign /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs index d16819b9ec2b..b377067ae958 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs index 301b1b97e0ef..9d2c3f3bb03a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleDefini /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs index f51ce39a3bc4..e383d2658a30 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs index 7b053b8c7003..27ded89d9c4d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storedPro /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string storedProcedureName /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string storedProcedureName, CancellationTok /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs index d7b1c42b674b..1ba39c7b87b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlStoredProcedureData DeserializeCosmosDBSqlStoredProce tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs index c9914ab0c153..d62143b2a1ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlStoredProcedureData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlStoredProcedureResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlStoredProcedureData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlStoredProcedureResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs index 04ecb94cfc7a..3b2a1bbfd04f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs index 8d90ed9e961f..56bd4ab22e1b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string triggerName, Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string triggerName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string triggerName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs index f7ac7a840113..0d46534a75bb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlTriggerData DeserializeCosmosDBSqlTriggerData(JsonEle tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs index 8b79d3227fcd..79829f99bd3d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlTriggerData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlTriggerResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlTriggerData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlTriggerResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs index 68be44dae995..1ddb79c0fd92 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs index 4b5f305b4ab9..19477003a3a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string userD /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string userDefinedFunction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string userDefinedFunctionName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs index 089a5bc8ef35..6901bf22a8be 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static CosmosDBSqlUserDefinedFunctionData DeserializeCosmosDBSqlUserDef tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs index 91c5bba499a2..4f863d7e6e67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.cs @@ -65,12 +65,10 @@ public CosmosDBSqlUserDefinedFunctionData(AzureLocation location) : base(locatio /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal CosmosDBSqlUserDefinedFunctionData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs index 41780b76d6c1..28676ac131d4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs index b27f7a0c37c9..51ed607eec12 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string table /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs index b4b14ebd0d88..9322d066e670 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static CosmosDBTableData DeserializeCosmosDBTableData(JsonElement eleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs index baf0259d5f46..4f7efaaf2389 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.cs @@ -66,13 +66,11 @@ public CosmosDBTableData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTablePropertiesResource resource, CosmosDBTablePropertiesOptions options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal CosmosDBTableData() /// Gets or sets the options. [WirePath("properties.options")] public CosmosDBTablePropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs index a3b288dcdb9c..a6ad74818704 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs @@ -110,7 +110,7 @@ public virtual CosmosTableThroughputSettingResource GetCosmosTableThroughputSett /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -190,7 +190,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -520,7 +520,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -756,7 +756,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs deleted file mode 100644 index ed059b52bf66..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPoolAccounts method from an instance of . - /// - public partial class CosmosDBThroughputPoolAccountCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics; - private readonly ThroughputPoolAccountsRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolAccountCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolAccountResource.ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient = new ThroughputPoolAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBThroughputPoolResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBThroughputPoolResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts - /// - /// - /// Operation Id - /// ThroughputPoolAccounts_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolAccountThroughputPoolAccountsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolAccountResource(Client, CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(e)), _cosmosDBThroughputPoolAccountThroughputPoolAccountsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, throughputPoolAccountName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs deleted file mode 100644 index 52478831ea40..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(AccountResourceIdentifier)) - { - writer.WritePropertyName("accountResourceIdentifier"u8); - writer.WriteStringValue(AccountResourceIdentifier); - } - if (Optional.IsDefined(AccountLocation)) - { - writer.WritePropertyName("accountLocation"u8); - writer.WriteStringValue(AccountLocation.Value); - } - if (options.Format != "W" && Optional.IsDefined(AccountInstanceId)) - { - writer.WritePropertyName("accountInstanceId"u8); - writer.WriteStringValue(AccountInstanceId); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolAccountData DeserializeCosmosDBThroughputPoolAccountData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - ResourceIdentifier accountResourceIdentifier = default; - AzureLocation? accountLocation = default; - string accountInstanceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountResourceIdentifier"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountResourceIdentifier = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountLocation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accountLocation = new AzureLocation(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("accountInstanceId"u8)) - { - accountInstanceId = property0.Value.GetString(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolAccountData( - id, - name, - type, - systemData, - provisioningState, - accountResourceIdentifier, - accountLocation, - accountInstanceId, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountResourceIdentifier), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountResourceIdentifier)) - { - builder.Append(" accountResourceIdentifier: "); - builder.AppendLine($"'{AccountResourceIdentifier.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountLocation)) - { - builder.Append(" accountLocation: "); - builder.AppendLine($"'{AccountLocation.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountInstanceId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accountInstanceId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccountInstanceId)) - { - builder.Append(" accountInstanceId: "); - if (AccountInstanceId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccountInstanceId}'''"); - } - else - { - builder.AppendLine($"'{AccountInstanceId}'"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolAccountData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs deleted file mode 100644 index 717c462d1b87..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPoolAccount data model. - /// An Azure Cosmos DB Throughputpool Account - /// - public partial class CosmosDBThroughputPoolAccountData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBThroughputPoolAccountData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A provisioning state of the ThroughputPool Account. - /// The resource identifier of global database account in the throughputPool. - /// The location of global database account in the throughputPool. - /// The instance id of global database account in the throughputPool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, ResourceIdentifier accountResourceIdentifier, AzureLocation? accountLocation, string accountInstanceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - AccountResourceIdentifier = accountResourceIdentifier; - AccountLocation = accountLocation; - AccountInstanceId = accountInstanceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A provisioning state of the ThroughputPool Account. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// The resource identifier of global database account in the throughputPool. - [WirePath("properties.accountResourceIdentifier")] - public ResourceIdentifier AccountResourceIdentifier { get; set; } - /// The location of global database account in the throughputPool. - [WirePath("properties.accountLocation")] - public AzureLocation? AccountLocation { get; set; } - /// The instance id of global database account in the throughputPool. - [WirePath("properties.accountInstanceId")] - public string AccountInstanceId { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs deleted file mode 100644 index 3a9f4402b8f6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolAccountResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs deleted file mode 100644 index 42a2f447cdea..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPoolAccount along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolAccountResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPoolAccount method. - /// - public partial class CosmosDBThroughputPoolAccountResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - /// The throughputPoolAccountName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics; - private readonly ThroughputPoolAccountRestOperations _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient; - private readonly CosmosDBThroughputPoolAccountData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools/throughputPoolAccounts"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolAccountResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, CosmosDBThroughputPoolAccountData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolAccountResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); - _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient = new ThroughputPoolAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolAccountThroughputPoolAccountApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolAccountData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics.CreateScope("CosmosDBThroughputPoolAccountResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolAccountOperationSource(Client), _cosmosDBThroughputPoolAccountThroughputPoolAccountClientDiagnostics, Pipeline, _cosmosDBThroughputPoolAccountThroughputPoolAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs deleted file mode 100644 index d40a06a0e8fb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCosmosDBThroughputPools method from an instance of . - /// - public partial class CosmosDBThroughputPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private readonly ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CosmosDBThroughputPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CosmosDBThroughputPoolResource.ResourceType, out string cosmosDBThroughputPoolThroughputPoolsApiVersion); - _cosmosDBThroughputPoolThroughputPoolsRestClient = new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all the ThroughputPools in a given resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBThroughputPoolThroughputPoolsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "CosmosDBThroughputPoolCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.Exists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolCollection.GetIfExists"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, throughputPoolName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs deleted file mode 100644 index 25017af2cfb9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolData DeserializeCosmosDBThroughputPoolData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - provisioningState, - maxThroughput, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxThroughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaxThroughput)) - { - builder.Append(" maxThroughput: "); - builder.AppendLine($"{MaxThroughput.Value}"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs deleted file mode 100644 index c288a9624cc5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the CosmosDBThroughputPool data model. - /// An Azure Cosmos DB Throughputpool. - /// - public partial class CosmosDBThroughputPoolData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public CosmosDBThroughputPoolData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CosmosDBThroughputPoolData() - { - } - - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs deleted file mode 100644 index e537ce88ec65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class CosmosDBThroughputPoolResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - CosmosDBThroughputPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs deleted file mode 100644 index 00e114667922..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a CosmosDBThroughputPool along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCosmosDBThroughputPoolResource method. - /// Otherwise you can get one from its parent resource using the GetCosmosDBThroughputPool method. - /// - public partial class CosmosDBThroughputPoolResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The throughputPoolName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolClientDiagnostics; - private readonly ThroughputPoolRestOperations _cosmosDBThroughputPoolThroughputPoolRestClient; - private readonly CosmosDBThroughputPoolData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/throughputPools"; - - /// Initializes a new instance of the class for mocking. - protected CosmosDBThroughputPoolResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, CosmosDBThroughputPoolData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CosmosDBThroughputPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _cosmosDBThroughputPoolThroughputPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cosmosDBThroughputPoolThroughputPoolApiVersion); - _cosmosDBThroughputPoolThroughputPoolRestClient = new ThroughputPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBThroughputPoolThroughputPoolApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CosmosDBThroughputPoolData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of CosmosDBThroughputPoolAccountResources in the CosmosDBThroughputPool. - /// An object representing collection of CosmosDBThroughputPoolAccountResources and their operations over a CosmosDBThroughputPoolAccountResource. - public virtual CosmosDBThroughputPoolAccountCollection GetCosmosDBThroughputPoolAccounts() - { - return GetCachedClient(client => new CosmosDBThroughputPoolAccountCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAccountAsync(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPoolAccounts().GetAsync(throughputPoolAccountName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName} - /// - /// - /// Operation Id - /// ThroughputPoolAccount_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPoolAccount(string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPoolAccounts().Get(throughputPoolAccountName, cancellationToken); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Get"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CosmosDBThroughputPoolResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Delete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Delete"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = await _cosmosDBThroughputPoolThroughputPoolRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Update - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cosmosDBThroughputPoolThroughputPoolClientDiagnostics.CreateScope("CosmosDBThroughputPoolResource.Update"); - scope.Start(); - try - { - var response = _cosmosDBThroughputPoolThroughputPoolRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new CosmosDBArmOperation(new CosmosDBThroughputPoolOperationSource(Client), _cosmosDBThroughputPoolThroughputPoolClientDiagnostics, Pipeline, _cosmosDBThroughputPoolThroughputPoolRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs index d478055e8356..5cbbd87b71c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs deleted file mode 100644 index 0d1fc81aff04..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDataTransferJobGetResults method from an instance of . - /// - public partial class DataTransferJobGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal DataTransferJobGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", DataTransferJobGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DataTransferJobGetResultResource.ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of Data Transfer jobs. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs - /// - /// - /// Operation Id - /// DataTransferJobs_ListByDatabaseAccount - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataTransferJobGetResultDataTransferJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataTransferJobGetResultResource(Client, DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(e)), _dataTransferJobGetResultDataTransferJobsClientDiagnostics, Pipeline, "DataTransferJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs deleted file mode 100644 index 1cfeffb56917..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - if (Optional.IsDefined(Destination)) - { - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - - internal static DataTransferJobGetResultData DeserializeDataTransferJobGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("jobName"u8)) - { - jobName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("source"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("destination"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property0.Value, options); - continue; - } - if (property0.NameEquals("status"u8)) - { - status = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("processedCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("totalCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("workerCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("error"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property0.Value, options); - continue; - } - if (property0.NameEquals("duration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property0.Value.GetTimeSpan("c"); - continue; - } - if (property0.NameEquals("mode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property0.Value.GetString()); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultData( - id, - name, - type, - systemData, - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 4, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 4, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs deleted file mode 100644 index 570098ac55e4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the DataTransferJobGetResult data model. - /// A Cosmos DB Data Transfer Job - /// - public partial class DataTransferJobGetResultData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DataTransferJobGetResultData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Job Name. - [WirePath("properties.jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("properties.source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("properties.destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("properties.status")] - public string Status { get; } - /// Processed Count. - [WirePath("properties.processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("properties.totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("properties.lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("properties.workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("properties.error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("properties.duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("properties.mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs deleted file mode 100644 index bd195cdfe057..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class DataTransferJobGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DataTransferJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs deleted file mode 100644 index ed1b946d3f5a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a DataTransferJobGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDataTransferJobGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetDataTransferJobGetResult method. - /// - public partial class DataTransferJobGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The jobName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _dataTransferJobGetResultDataTransferJobsClientDiagnostics; - private readonly DataTransferJobsRestOperations _dataTransferJobGetResultDataTransferJobsRestClient; - private readonly DataTransferJobGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/dataTransferJobs"; - - /// Initializes a new instance of the class for mocking. - protected DataTransferJobGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, DataTransferJobGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal DataTransferJobGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _dataTransferJobGetResultDataTransferJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string dataTransferJobGetResultDataTransferJobsApiVersion); - _dataTransferJobGetResultDataTransferJobsRestClient = new DataTransferJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataTransferJobGetResultDataTransferJobsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DataTransferJobGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Get"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName} - /// - /// - /// Operation Id - /// DataTransferJobs_Create - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Update"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var uri = _dataTransferJobGetResultDataTransferJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new CosmosDBArmOperation(Response.FromValue(new DataTransferJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> PauseAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Pause a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause - /// - /// - /// Operation Id - /// DataTransferJobs_Pause - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Pause(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Pause"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> ResumeAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Resumes a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume - /// - /// - /// Operation Id - /// DataTransferJobs_Resume - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Resume(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Resume"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CancelAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cancels a Data Transfer Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel - /// - /// - /// Operation Id - /// DataTransferJobs_Cancel - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Cancel(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Cancel"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CompleteAsync(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = await _dataTransferJobGetResultDataTransferJobsRestClient.CompleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Completes a Data Transfer Online Job. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete - /// - /// - /// Operation Id - /// DataTransferJobs_Complete - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Complete(CancellationToken cancellationToken = default) - { - using var scope = _dataTransferJobGetResultDataTransferJobsClientDiagnostics.CreateScope("DataTransferJobGetResultResource.Complete"); - scope.Start(); - try - { - var response = _dataTransferJobGetResultDataTransferJobsRestClient.Complete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new DataTransferJobGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index 372694acc197..e20c9c25009a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -37,25 +37,6 @@ private static MockableCosmosDBTenantResource GetMockableCosmosDBTenantResource( return resource.GetCachedClient(client => new MockableCosmosDBTenantResource(client, resource.Id)); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetNetworkSecurityPerimeterConfigurationResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -75,25 +56,6 @@ public static CosmosDBAccountResource GetCosmosDBAccountResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBAccountResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static GraphResourceGetResultResource GetGraphResourceGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetGraphResourceGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -246,25 +208,6 @@ public static CassandraTableThroughputSettingResource GetCassandraTableThroughpu return GetMockableCosmosDBArmClient(client).GetCassandraTableThroughputSettingResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewThroughputSettingResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -304,41 +247,41 @@ public static GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSet } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlContainerResource(id); + return GetMockableCosmosDBArmClient(client).GetCosmosDBSqlClientEncryptionKeyResource(id); } /// @@ -569,25 +512,6 @@ public static CassandraTableResource GetCassandraTableResource(this ArmClient cl return GetMockableCosmosDBArmClient(client).GetCassandraTableResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CassandraViewGetResultResource GetCassandraViewGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCassandraViewGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -645,25 +569,6 @@ public static CosmosDBLocationResource GetCosmosDBLocationResource(this ArmClien return GetMockableCosmosDBArmClient(client).GetCosmosDBLocationResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetDataTransferJobGetResultResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -778,44 +683,6 @@ public static CosmosDBServiceResource GetCosmosDBServiceResource(this ArmClient return GetMockableCosmosDBArmClient(client).GetCosmosDBServiceResource(id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolAccountResource(id); - } - /// /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. /// @@ -846,7 +713,7 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -884,7 +751,7 @@ public static async Task> GetCosmosDBAccountAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -939,7 +806,7 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -977,7 +844,7 @@ public static async Task> GetCassandraCluster /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1002,99 +869,6 @@ public static Response GetCassandraCluster(this Resour return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCassandraCluster(clusterName, cancellationToken); } - /// - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public static CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPools(); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetCosmosDBThroughputPoolAsync(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPoolAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetCosmosDBThroughputPool(this ResourceGroupResource resourceGroupResource, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPool(throughputPoolName, cancellationToken); - } - /// /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. /// @@ -1125,7 +899,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1162,7 +936,7 @@ public static async Task> GetCosmosDBLocation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1199,7 +973,7 @@ public static Response GetCosmosDBLocation(this Subscr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1235,7 +1009,7 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1271,7 +1045,7 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1307,7 +1081,7 @@ public static AsyncPageable GetCassandraClustersAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1343,7 +1117,7 @@ public static Pageable GetCassandraClusters(this Subsc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1379,7 +1153,7 @@ public static AsyncPageable GetRestorableCosm /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1402,78 +1176,6 @@ public static Pageable GetRestorableCosmosDBA return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetRestorableCosmosDBAccounts(cancellationToken); } - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCosmosDBThroughputPoolsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPoolsAsync(cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCosmosDBThroughputPools(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - - return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPools(cancellationToken); - } - /// /// Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. /// @@ -1487,7 +1189,7 @@ public static Pageable GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -1524,7 +1226,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs index db7a53d5ec28..46b5ff6c6c8e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(ResourceIdentifier id) - { - NetworkSecurityPerimeterConfigurationResource.ValidateResourceId(id); - return new NetworkSecurityPerimeterConfigurationResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,18 +46,6 @@ public virtual CosmosDBAccountResource GetCosmosDBAccountResource(ResourceIdenti return new CosmosDBAccountResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual GraphResourceGetResultResource GetGraphResourceGetResultResource(ResourceIdentifier id) - { - GraphResourceGetResultResource.ValidateResourceId(id); - return new GraphResourceGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -166,18 +142,6 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp return new CassandraTableThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(ResourceIdentifier id) - { - CassandraViewThroughputSettingResource.ValidateResourceId(id); - return new CassandraViewThroughputSettingResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -202,18 +166,6 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe return new GremlinGraphThroughputSettingResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) - { - CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); - return new CosmosDBSqlClientEncryptionKeyResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -226,6 +178,18 @@ public virtual CosmosDBSqlContainerResource GetCosmosDBSqlContainerResource(Reso return new CosmosDBSqlContainerResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CosmosDBSqlClientEncryptionKeyResource GetCosmosDBSqlClientEncryptionKeyResource(ResourceIdentifier id) + { + CosmosDBSqlClientEncryptionKeyResource.ValidateResourceId(id); + return new CosmosDBSqlClientEncryptionKeyResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -370,18 +334,6 @@ public virtual CassandraTableResource GetCassandraTableResource(ResourceIdentifi return new CassandraTableResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CassandraViewGetResultResource GetCassandraViewGetResultResource(ResourceIdentifier id) - { - CassandraViewGetResultResource.ValidateResourceId(id); - return new CassandraViewGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -418,18 +370,6 @@ public virtual CosmosDBLocationResource GetCosmosDBLocationResource(ResourceIden return new CosmosDBLocationResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual DataTransferJobGetResultResource GetDataTransferJobGetResultResource(ResourceIdentifier id) - { - DataTransferJobGetResultResource.ValidateResourceId(id); - return new DataTransferJobGetResultResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -501,29 +441,5 @@ public virtual CosmosDBServiceResource GetCosmosDBServiceResource(ResourceIdenti CosmosDBServiceResource.ValidateResourceId(id); return new CosmosDBServiceResource(Client, id); } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAccountResource(ResourceIdentifier id) - { - CosmosDBThroughputPoolAccountResource.ValidateResourceId(id); - return new CosmosDBThroughputPoolAccountResource(Client, id); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs index f2f1f6c662dd..e6a299fdb62d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual CosmosDBAccountCollection GetCosmosDBAccounts() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCosmosDBAccountA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CassandraClusterCollection GetCassandraClusters() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCassandraCluste /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -170,74 +170,5 @@ public virtual Response GetCassandraCluster(string clu { return GetCassandraClusters().Get(clusterName, cancellationToken); } - - /// Gets a collection of CosmosDBThroughputPoolResources in the ResourceGroupResource. - /// An object representing collection of CosmosDBThroughputPoolResources and their operations over a CosmosDBThroughputPoolResource. - public virtual CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() - { - return GetCachedClient(client => new CosmosDBThroughputPoolCollection(client, Id)); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCosmosDBThroughputPoolAsync(string throughputPoolName, CancellationToken cancellationToken = default) - { - return await GetCosmosDBThroughputPools().GetAsync(throughputPoolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName} - /// - /// - /// Operation Id - /// ThroughputPool_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCosmosDBThroughputPool(string throughputPoolName, CancellationToken cancellationToken = default) - { - return GetCosmosDBThroughputPools().Get(throughputPoolName, cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs index 24d162e81730..0c1998dc020c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs @@ -22,8 +22,6 @@ public partial class MockableCosmosDBSubscriptionResource : ArmResource private CassandraClustersRestOperations _cassandraClusterRestClient; private ClientDiagnostics _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics; private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; - private ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; - private ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; /// Initializes a new instance of the class for mocking. protected MockableCosmosDBSubscriptionResource() @@ -43,8 +41,6 @@ internal MockableCosmosDBSubscriptionResource(ArmClient client, ResourceIdentifi private CassandraClustersRestOperations CassandraClusterRestClient => _cassandraClusterRestClient ??= new CassandraClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CassandraClusterResource.ResourceType)); private ClientDiagnostics RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics => _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", RestorableCosmosDBAccountResource.ResourceType.Namespace, Diagnostics); private RestorableDatabaseAccountsRestOperations RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient => _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient ??= new RestorableDatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(RestorableCosmosDBAccountResource.ResourceType)); - private ClientDiagnostics CosmosDBThroughputPoolThroughputPoolsClientDiagnostics => _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); - private ThroughputPoolsRestOperations CosmosDBThroughputPoolThroughputPoolsRestClient => _cosmosDBThroughputPoolThroughputPoolsRestClient ??= new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CosmosDBThroughputPoolResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -72,7 +68,7 @@ public virtual CosmosDBLocationCollection GetCosmosDBLocations() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -101,7 +97,7 @@ public virtual async Task> GetCosmosDBLocatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -130,7 +126,7 @@ public virtual Response GetCosmosDBLocation(AzureLocat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -159,7 +155,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -188,7 +184,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -217,7 +213,7 @@ public virtual AsyncPageable GetCassandraClustersAsync /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -246,7 +242,7 @@ public virtual Pageable GetCassandraClusters(Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +271,7 @@ public virtual AsyncPageable GetRestorableCos /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -290,65 +286,5 @@ public virtual Pageable GetRestorableCosmosDB HttpMessage FirstPageRequest(int? pageSizeHint) => RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient.CreateListRequest(Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new RestorableCosmosDBAccountResource(Client, RestorableCosmosDBAccountData.DeserializeRestorableCosmosDBAccountData(e)), RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetRestorableCosmosDBAccounts", "value", null, cancellationToken); } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCosmosDBThroughputPoolsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools - /// - /// - /// Operation Id - /// ThroughputPools_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCosmosDBThroughputPools(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs index 354a9e67a9af..85fbe45cfb20 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs @@ -53,7 +53,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -96,7 +96,7 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs deleted file mode 100644 index bcfdade2f354..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetGraphResourceGetResults method from an instance of . - /// - public partial class GraphResourceGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal GraphResourceGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", GraphResourceGetResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GraphResourceGetResultResource.ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Cosmos DB graph resource name. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs - /// - /// - /// Operation Id - /// GraphResources_ListGraphs - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _graphResourceGetResultGraphResourcesRestClient.CreateListGraphsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GraphResourceGetResultResource(Client, GraphResourceGetResultData.DeserializeGraphResourceGetResultData(e)), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, "GraphResourceGetResultCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.Exists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Cosmos DB graph resource name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultCollection.GetIfExists"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, graphName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs deleted file mode 100644 index 7a2d7010da26..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - } - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - - internal static GraphResourceGetResultData DeserializeGraphResourceGetResultData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - GraphResourceGetPropertiesOptions options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = GraphResourceGetPropertiesOptions.DeserializeGraphResourceGetPropertiesOptions(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetResultData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs deleted file mode 100644 index 7210bb573190..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the GraphResourceGetResult data model. - /// An Azure Cosmos DB Graph resource. - /// - public partial class GraphResourceGetResultData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public GraphResourceGetResultData(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the resource. - /// - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, GraphResourceGetPropertiesOptions options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultData() - { - } - - /// Gets or sets the resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// Gets or sets the options. - [WirePath("properties.options")] - public GraphResourceGetPropertiesOptions Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs deleted file mode 100644 index 9cabba2759d1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class GraphResourceGetResultResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - GraphResourceGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs deleted file mode 100644 index 26de982a8d08..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a GraphResourceGetResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetGraphResourceGetResultResource method. - /// Otherwise you can get one from its parent resource using the GetGraphResourceGetResult method. - /// - public partial class GraphResourceGetResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The graphName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _graphResourceGetResultGraphResourcesClientDiagnostics; - private readonly GraphResourcesRestOperations _graphResourceGetResultGraphResourcesRestClient; - private readonly GraphResourceGetResultData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/graphs"; - - /// Initializes a new instance of the class for mocking. - protected GraphResourceGetResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, GraphResourceGetResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal GraphResourceGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _graphResourceGetResultGraphResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string graphResourceGetResultGraphResourcesApiVersion); - _graphResourceGetResultGraphResourcesRestClient = new GraphResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, graphResourceGetResultGraphResourcesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GraphResourceGetResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Get"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GraphResourceGetResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_DeleteGraphResource - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Delete"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.DeleteGraphResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateDeleteGraphResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = await _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create or update an Azure Cosmos DB Graph. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_CreateUpdateGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for the current graph. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.Update"); - scope.Start(); - try - { - var response = _graphResourceGetResultGraphResourcesRestClient.CreateUpdateGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new CosmosDBArmOperation(new GraphResourceGetResultOperationSource(Client), _graphResourceGetResultGraphResourcesClientDiagnostics, Pipeline, _graphResourceGetResultGraphResourcesRestClient.CreateCreateUpdateGraphRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _graphResourceGetResultGraphResourcesRestClient.GetGraphAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName} - /// - /// - /// Operation Id - /// GraphResources_GetGraph - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _graphResourceGetResultGraphResourcesClientDiagnostics.CreateScope("GraphResourceGetResultResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _graphResourceGetResultGraphResourcesRestClient.GetGraph(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new GraphResourceGetResultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GraphResourceGetResultCreateOrUpdateContent(current.Location, current.Resource); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs index d4f289dcf02e..5b4a82aff198 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs index 14949bb6f7b6..c682de422ba2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static GremlinDatabaseData DeserializeGremlinDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs index 7c1234e5de4d..98733e89aa61 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.cs @@ -66,13 +66,11 @@ public GremlinDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinDatabaseResourceInfo resource, GremlinDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs index a4eea9996c9e..f890162e7b3c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual GremlinGraphCollection GetGremlinGraphs() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetGremlinGraph(string graphName, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs index d9eccd4d38d9..df5db1157fea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs index d4ad9be40192..6e69fb52f947 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string graphN /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs index 21dac0e3f4ae..1c87083a074a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static GremlinGraphData DeserializeGremlinGraphData(JsonElement element location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs index 777952f74990..6b4043d8f297 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.cs @@ -66,13 +66,11 @@ public GremlinGraphData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedGremlinGraphResourceInfo resource, GremlinGraphPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal GremlinGraphData() /// Gets or sets the options. [WirePath("properties.options")] public GremlinGraphPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs index ae2f9830c994..78209ea1d4a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs @@ -111,7 +111,7 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Gr /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -583,7 +583,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -697,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -757,7 +757,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs index 6373bf94d35f..95ffa5e40699 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs index 3ad5ec571757..9f3dddd96e94 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraKeyspaceThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs index 7edc805329e2..21361edbd316 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraTableThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs deleted file mode 100644 index 70a5c5bfecd8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewGetResultOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewGetResultOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return new CassandraViewGetResultResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs deleted file mode 100644 index 1394eb087f80..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraViewThroughputSettingOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CassandraViewThroughputSettingOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CassandraViewThroughputSettingOperationSource(ArmClient client) - { - _client = client; - } - - CassandraViewThroughputSettingResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return new CassandraViewThroughputSettingResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs index af9245a5fb97..f492aadeb1d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlContainerThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs index 0fe23f1c89bc..33bd0f9f59dd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBSqlDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs deleted file mode 100644 index 30abec784760..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolAccountOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolAccountOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolAccountOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolAccountResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return new CosmosDBThroughputPoolAccountResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs deleted file mode 100644 index a6ce37b70457..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBThroughputPoolOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class CosmosDBThroughputPoolOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal CosmosDBThroughputPoolOperationSource(ArmClient client) - { - _client = client; - } - - CosmosDBThroughputPoolResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return new CosmosDBThroughputPoolResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs index 0e5c9833df92..3795d6f36e70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosTableThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs deleted file mode 100644 index 6c63eaa3b485..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GraphResourceGetResultOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class GraphResourceGetResultOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal GraphResourceGetResultOperationSource(ArmClient client) - { - _client = client; - } - - GraphResourceGetResultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return new GraphResourceGetResultResource(_client, data); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs index 7b1093b43f5e..3edf9d05727d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs index b1f6eaa5b4bf..b67f22dee77a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinGraphThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs index ba0caf7dfd63..e74999f5c334 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBCollectionThroughputSettingOperationSource.cs @@ -64,7 +64,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs index 4c5eab41e545..7e20cabb630a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoDBDatabaseThroughputSettingOperationSource.cs @@ -62,7 +62,6 @@ private ThroughputSettingData ScrubId(ThroughputSettingData data) data.Tags, data.Location, data.Resource, - data.Identity, null); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs deleted file mode 100644 index e78c5f9955ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionStorageInfoCollectionOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionStorageInfoCollectionOperationSource : IOperationSource - { - PhysicalPartitionStorageInfoCollection IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionStorageInfoCollection.DeserializePhysicalPartitionStorageInfoCollection(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs deleted file mode 100644 index bcda0825749f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/PhysicalPartitionThroughputInfoResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal class PhysicalPartitionThroughputInfoResultOperationSource : IOperationSource - { - PhysicalPartitionThroughputInfoResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return PhysicalPartitionThroughputInfoResult.DeserializePhysicalPartitionThroughputInfoResult(document.RootElement); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs deleted file mode 100644 index c92851b175a9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRule(document.RootElement, options); - } - - internal static AccessRule DeserializeAccessRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - AccessRuleProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = AccessRuleProperties.DeserializeAccessRuleProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRule(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{options.Format}' format."); - } - } - - AccessRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs deleted file mode 100644 index 6a99ca26cdbc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Access rule in a network security perimeter configuration profile. - public partial class AccessRule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AccessRule() - { - } - - /// Initializes a new instance of . - /// Name of the access rule. - /// Properties of Access Rule. - /// Keeps track of any properties unknown to the library. - internal AccessRule(string name, AccessRuleProperties properties, IDictionary serializedAdditionalRawData) - { - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the access rule. - [WirePath("name")] - public string Name { get; set; } - /// Properties of Access Rule. - [WirePath("properties")] - public AccessRuleProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs deleted file mode 100644 index 683fd7d3354b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleDirection.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Direction of Access Rule. - public readonly partial struct AccessRuleDirection : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AccessRuleDirection(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InboundValue = "Inbound"; - private const string OutboundValue = "Outbound"; - - /// Applies to inbound network traffic to the secured resources. - public static AccessRuleDirection Inbound { get; } = new AccessRuleDirection(InboundValue); - /// Applies to outbound network traffic from the secured resources. - public static AccessRuleDirection Outbound { get; } = new AccessRuleDirection(OutboundValue); - /// Determines if two values are the same. - public static bool operator ==(AccessRuleDirection left, AccessRuleDirection right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AccessRuleDirection left, AccessRuleDirection right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator AccessRuleDirection(string value) => new AccessRuleDirection(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AccessRuleDirection other && Equals(other); - /// - public bool Equals(AccessRuleDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs deleted file mode 100644 index cd897a3892f0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AccessRuleProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Direction)) - { - writer.WritePropertyName("direction"u8); - writer.WriteStringValue(Direction.Value.ToString()); - } - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - writer.WritePropertyName("addressPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in AddressPrefixes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Subscriptions)) - { - writer.WritePropertyName("subscriptions"u8); - writer.WriteStartArray(); - foreach (var item in Subscriptions) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - writer.WritePropertyName("networkSecurityPerimeters"u8); - writer.WriteStartArray(); - foreach (var item in NetworkSecurityPerimeters) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - writer.WritePropertyName("fullyQualifiedDomainNames"u8); - writer.WriteStartArray(); - foreach (var item in FullyQualifiedDomainNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(EmailAddresses)) - { - writer.WritePropertyName("emailAddresses"u8); - writer.WriteStartArray(); - foreach (var item in EmailAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - writer.WritePropertyName("phoneNumbers"u8); - writer.WriteStartArray(); - foreach (var item in PhoneNumbers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - - internal static AccessRuleProperties DeserializeAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AccessRuleDirection? direction = default; - IList addressPrefixes = default; - IList subscriptions = default; - IList networkSecurityPerimeters = default; - IList fullyQualifiedDomainNames = default; - IList emailAddresses = default; - IList phoneNumbers = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("direction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - direction = new AccessRuleDirection(property.Value.GetString()); - continue; - } - if (property.NameEquals("addressPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - addressPrefixes = array; - continue; - } - if (property.NameEquals("subscriptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - subscriptions = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item, options)); - } - networkSecurityPerimeters = array; - continue; - } - if (property.NameEquals("fullyQualifiedDomainNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - fullyQualifiedDomainNames = array; - continue; - } - if (property.NameEquals("emailAddresses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - emailAddresses = array; - continue; - } - if (property.NameEquals("phoneNumbers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - phoneNumbers = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AccessRuleProperties( - direction, - addressPrefixes ?? new ChangeTrackingList(), - subscriptions ?? new ChangeTrackingList(), - networkSecurityPerimeters ?? new ChangeTrackingList(), - fullyQualifiedDomainNames ?? new ChangeTrackingList(), - emailAddresses ?? new ChangeTrackingList(), - phoneNumbers ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Direction), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" direction: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Direction)) - { - builder.Append(" direction: "); - builder.AppendLine($"'{Direction.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AddressPrefixes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AddressPrefixes)) - { - if (AddressPrefixes.Any()) - { - builder.Append(" addressPrefixes: "); - builder.AppendLine("["); - foreach (var item in AddressPrefixes) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Subscriptions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" subscriptions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Subscriptions)) - { - if (Subscriptions.Any()) - { - builder.Append(" subscriptions: "); - builder.AppendLine("["); - foreach (var item in Subscriptions) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " subscriptions: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) - { - if (NetworkSecurityPerimeters.Any()) - { - builder.Append(" networkSecurityPerimeters: "); - builder.AppendLine("["); - foreach (var item in NetworkSecurityPerimeters) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkSecurityPerimeters: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullyQualifiedDomainNames), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) - { - if (FullyQualifiedDomainNames.Any()) - { - builder.Append(" fullyQualifiedDomainNames: "); - builder.AppendLine("["); - foreach (var item in FullyQualifiedDomainNames) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EmailAddresses), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" emailAddresses: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EmailAddresses)) - { - if (EmailAddresses.Any()) - { - builder.Append(" emailAddresses: "); - builder.AppendLine("["); - foreach (var item in EmailAddresses) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhoneNumbers), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhoneNumbers)) - { - if (PhoneNumbers.Any()) - { - builder.Append(" phoneNumbers: "); - builder.AppendLine("["); - foreach (var item in PhoneNumbers) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{options.Format}' format."); - } - } - - AccessRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAccessRuleProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs deleted file mode 100644 index 5f258218ce35..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Properties of Access Rule. - public partial class AccessRuleProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public AccessRuleProperties() - { - AddressPrefixes = new ChangeTrackingList(); - Subscriptions = new ChangeTrackingList(); - NetworkSecurityPerimeters = new ChangeTrackingList(); - FullyQualifiedDomainNames = new ChangeTrackingList(); - EmailAddresses = new ChangeTrackingList(); - PhoneNumbers = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Direction of Access Rule. - /// Address prefixes in the CIDR format for inbound rules. - /// Subscriptions for inbound rules. - /// Network security perimeters for inbound rules. - /// Fully qualified domain names (FQDN) for outbound rules. - /// Email addresses for outbound rules. - /// Phone numbers for outbound rules. - /// Keeps track of any properties unknown to the library. - internal AccessRuleProperties(AccessRuleDirection? direction, IList addressPrefixes, IList subscriptions, IList networkSecurityPerimeters, IList fullyQualifiedDomainNames, IList emailAddresses, IList phoneNumbers, IDictionary serializedAdditionalRawData) - { - Direction = direction; - AddressPrefixes = addressPrefixes; - Subscriptions = subscriptions; - NetworkSecurityPerimeters = networkSecurityPerimeters; - FullyQualifiedDomainNames = fullyQualifiedDomainNames; - EmailAddresses = emailAddresses; - PhoneNumbers = phoneNumbers; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Direction of Access Rule. - [WirePath("direction")] - public AccessRuleDirection? Direction { get; set; } - /// Address prefixes in the CIDR format for inbound rules. - [WirePath("addressPrefixes")] - public IList AddressPrefixes { get; } - /// Subscriptions for inbound rules. - [WirePath("subscriptions")] - public IList Subscriptions { get; } - /// Network security perimeters for inbound rules. - [WirePath("networkSecurityPerimeters")] - public IList NetworkSecurityPerimeters { get; } - /// Fully qualified domain names (FQDN) for outbound rules. - [WirePath("fullyQualifiedDomainNames")] - public IList FullyQualifiedDomainNames { get; } - /// Email addresses for outbound rules. - [WirePath("emailAddresses")] - public IList EmailAddresses { get; } - /// Phone numbers for outbound rules. - [WirePath("phoneNumbers")] - public IList PhoneNumbers { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs index e9dee759a0bf..a2a3c4a80813 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.cs @@ -51,7 +51,7 @@ public ApiProperties() } /// Initializes a new instance of . - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. /// Keeps track of any properties unknown to the library. internal ApiProperties(CosmosDBServerVersion? serverVersion, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal ApiProperties(CosmosDBServerVersion? serverVersion, IDictionary Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("serverVersion")] public CosmosDBServerVersion? ServerVersion { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index a7dfdd43049e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class AzureBlobDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(EndpointUri)) - { - writer.WritePropertyName("endpointUrl"u8); - writer.WriteStringValue(EndpointUri.AbsoluteUri); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - AzureBlobDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - - internal static AzureBlobDataTransferDataSourceSink DeserializeAzureBlobDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string containerName = default; - Uri endpointUrl = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("endpointUrl"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endpointUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new AzureBlobDataTransferDataSourceSink(component, serializedAdditionalRawData, containerName, endpointUrl); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndpointUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" endpointUrl: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EndpointUri)) - { - builder.Append(" endpointUrl: "); - builder.AppendLine($"'{EndpointUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - AzureBlobDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeAzureBlobDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs deleted file mode 100644 index 0beca6426b11..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Blob Storage data source/sink. - public partial class AzureBlobDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// is null. - public AzureBlobDataTransferDataSourceSink(string containerName) - { - Argument.AssertNotNull(containerName, nameof(containerName)); - - ContainerName = containerName; - Component = DataTransferComponent.AzureBlobStorage; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - internal AzureBlobDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string containerName, Uri endpointUri) : base(component, serializedAdditionalRawData) - { - ContainerName = containerName; - EndpointUri = endpointUri; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal AzureBlobDataTransferDataSourceSink() - { - } - - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - /// Gets or sets the endpoint uri. - [WirePath("endpointUrl")] - public Uri EndpointUri { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 45fe531a8667..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class BaseCosmosDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - BaseCosmosDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - - internal static BaseCosmosDataTransferDataSourceSink DeserializeBaseCosmosDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - string remoteAccountName = default; - DataTransferComponent component = "BaseCosmosDataTransferDataSourceSink"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BaseCosmosDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - BaseCosmosDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBaseCosmosDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs deleted file mode 100644 index 572917dec35e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// A base CosmosDB data source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public partial class BaseCosmosDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - public BaseCosmosDataTransferDataSourceSink() - { - Component = new DataTransferComponent("BaseCosmosDataTransferDataSourceSink"); - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - internal BaseCosmosDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName) : base(component, serializedAdditionalRawData) - { - RemoteAccountName = remoteAccountName; - Component = component; - } - - /// Gets or sets the remote account name. - [WirePath("remoteAccountName")] - public string RemoteAccountName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs deleted file mode 100644 index f5383aea90ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates the capacity mode of the account. - public readonly partial struct CapacityMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string ProvisionedValue = "Provisioned"; - private const string ServerlessValue = "Serverless"; - - /// None. - public static CapacityMode None { get; } = new CapacityMode(NoneValue); - /// Provisioned. - public static CapacityMode Provisioned { get; } = new CapacityMode(ProvisionedValue); - /// Serverless. - public static CapacityMode Serverless { get; } = new CapacityMode(ServerlessValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityMode left, CapacityMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityMode left, CapacityMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CapacityMode(string value) => new CapacityMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityMode other && Equals(other); - /// - public bool Equals(CapacityMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs deleted file mode 100644 index db4ddb606122..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CapacityModeChangeTransitionState : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - writer.WritePropertyName("capacityModeTransitionStatus"u8); - writer.WriteStringValue(CapacityModeTransitionStatus.Value.ToString()); - } - if (Optional.IsDefined(CurrentCapacityMode)) - { - writer.WritePropertyName("currentCapacityMode"u8); - writer.WriteStringValue(CurrentCapacityMode.Value.ToString()); - } - if (Optional.IsDefined(PreviousCapacityMode)) - { - writer.WritePropertyName("previousCapacityMode"u8); - writer.WriteStringValue(PreviousCapacityMode.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionBeginTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionBeginTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - writer.WritePropertyName("capacityModeLastSuccessfulTransitionEndTimestamp"u8); - writer.WriteStringValue(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CapacityModeChangeTransitionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - - internal static CapacityModeChangeTransitionState DeserializeCapacityModeChangeTransitionState(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CapacityModeTransitionStatus? capacityModeTransitionStatus = default; - CapacityMode? currentCapacityMode = default; - CapacityMode? previousCapacityMode = default; - DateTimeOffset? capacityModeTransitionBeginTimestamp = default; - DateTimeOffset? capacityModeTransitionEndTimestamp = default; - DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("capacityModeTransitionStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionStatus = new CapacityModeTransitionStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("currentCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - currentCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("previousCapacityMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - previousCapacityMode = new CapacityMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("capacityModeTransitionBeginTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionBeginTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("capacityModeLastSuccessfulTransitionEndTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityModeLastSuccessfulTransitionEndTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CapacityModeChangeTransitionState( - capacityModeTransitionStatus, - currentCapacityMode, - previousCapacityMode, - capacityModeTransitionBeginTimestamp, - capacityModeTransitionEndTimestamp, - capacityModeLastSuccessfulTransitionEndTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionStatus), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionStatus)) - { - builder.Append(" capacityModeTransitionStatus: "); - builder.AppendLine($"'{CapacityModeTransitionStatus.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CurrentCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CurrentCapacityMode)) - { - builder.Append(" currentCapacityMode: "); - builder.AppendLine($"'{CurrentCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PreviousCapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PreviousCapacityMode)) - { - builder.Append(" previousCapacityMode: "); - builder.AppendLine($"'{PreviousCapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionBeginTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionBeginTimestamp)) - { - builder.Append(" capacityModeTransitionBeginTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionBeginTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeTransitionEndTimestamp)) - { - builder.Append(" capacityModeTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityModeLastSuccessfulTransitionEndTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityModeLastSuccessfulTransitionEndTimestamp)) - { - builder.Append(" capacityModeLastSuccessfulTransitionEndTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(CapacityModeLastSuccessfulTransitionEndTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{options.Format}' format."); - } - } - - CapacityModeChangeTransitionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCapacityModeChangeTransitionState(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs deleted file mode 100644 index d84fd207dee9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition state information related capacity mode change with update request. - public partial class CapacityModeChangeTransitionState - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CapacityModeChangeTransitionState() - { - } - - /// Initializes a new instance of . - /// The transition status of capacity mode. - /// Indicates the current capacity mode of the account. - /// Indicates the previous capacity mode of the account before successful transition. - /// Begin time in UTC of the capacity mode change. - /// End time in UTC of the capacity mode change. - /// End time in UTC of the last successful capacity mode change. - /// Keeps track of any properties unknown to the library. - internal CapacityModeChangeTransitionState(CapacityModeTransitionStatus? capacityModeTransitionStatus, CapacityMode? currentCapacityMode, CapacityMode? previousCapacityMode, DateTimeOffset? capacityModeTransitionBeginTimestamp, DateTimeOffset? capacityModeTransitionEndTimestamp, DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp, IDictionary serializedAdditionalRawData) - { - CapacityModeTransitionStatus = capacityModeTransitionStatus; - CurrentCapacityMode = currentCapacityMode; - PreviousCapacityMode = previousCapacityMode; - CapacityModeTransitionBeginTimestamp = capacityModeTransitionBeginTimestamp; - CapacityModeTransitionEndTimestamp = capacityModeTransitionEndTimestamp; - CapacityModeLastSuccessfulTransitionEndTimestamp = capacityModeLastSuccessfulTransitionEndTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The transition status of capacity mode. - [WirePath("capacityModeTransitionStatus")] - public CapacityModeTransitionStatus? CapacityModeTransitionStatus { get; set; } - /// Indicates the current capacity mode of the account. - [WirePath("currentCapacityMode")] - public CapacityMode? CurrentCapacityMode { get; set; } - /// Indicates the previous capacity mode of the account before successful transition. - [WirePath("previousCapacityMode")] - public CapacityMode? PreviousCapacityMode { get; set; } - /// Begin time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionBeginTimestamp")] - public DateTimeOffset? CapacityModeTransitionBeginTimestamp { get; } - /// End time in UTC of the capacity mode change. - [WirePath("capacityModeTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeTransitionEndTimestamp { get; } - /// End time in UTC of the last successful capacity mode change. - [WirePath("capacityModeLastSuccessfulTransitionEndTimestamp")] - public DateTimeOffset? CapacityModeLastSuccessfulTransitionEndTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs deleted file mode 100644 index ce09601aeb62..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeTransitionStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The transition status of capacity mode. - public readonly partial struct CapacityModeTransitionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CapacityModeTransitionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InvalidValue = "Invalid"; - private const string InitializedValue = "Initialized"; - private const string InProgressValue = "InProgress"; - private const string CompletedValue = "Completed"; - private const string FailedValue = "Failed"; - - /// Invalid. - public static CapacityModeTransitionStatus Invalid { get; } = new CapacityModeTransitionStatus(InvalidValue); - /// Initialized. - public static CapacityModeTransitionStatus Initialized { get; } = new CapacityModeTransitionStatus(InitializedValue); - /// InProgress. - public static CapacityModeTransitionStatus InProgress { get; } = new CapacityModeTransitionStatus(InProgressValue); - /// Completed. - public static CapacityModeTransitionStatus Completed { get; } = new CapacityModeTransitionStatus(CompletedValue); - /// Failed. - public static CapacityModeTransitionStatus Failed { get; } = new CapacityModeTransitionStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CapacityModeTransitionStatus left, CapacityModeTransitionStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CapacityModeTransitionStatus(string value) => new CapacityModeTransitionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CapacityModeTransitionStatus other && Equals(other); - /// - public bool Equals(CapacityModeTransitionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs deleted file mode 100644 index 0ac79482e873..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAutoReplicateForm.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The form of AutoReplicate that is being used by this cluster. - public readonly partial struct CassandraAutoReplicateForm : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraAutoReplicateForm(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string SystemKeyspacesValue = "SystemKeyspaces"; - private const string AllKeyspacesValue = "AllKeyspaces"; - - /// None. - public static CassandraAutoReplicateForm None { get; } = new CassandraAutoReplicateForm(NoneValue); - /// SystemKeyspaces. - public static CassandraAutoReplicateForm SystemKeyspaces { get; } = new CassandraAutoReplicateForm(SystemKeyspacesValue); - /// AllKeyspaces. - public static CassandraAutoReplicateForm AllKeyspaces { get; } = new CassandraAutoReplicateForm(AllKeyspacesValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraAutoReplicateForm left, CassandraAutoReplicateForm right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraAutoReplicateForm(string value) => new CassandraAutoReplicateForm(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraAutoReplicateForm other && Equals(other); - /// - public bool Equals(CassandraAutoReplicateForm other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs deleted file mode 100644 index fa718e7abcd9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupResourceInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(BackupId)) - { - writer.WritePropertyName("backupId"u8); - writer.WriteStringValue(BackupId); - } - if (Optional.IsDefined(BackupState)) - { - writer.WritePropertyName("backupState"u8); - writer.WriteStringValue(BackupState.Value.ToString()); - } - if (Optional.IsDefined(BackupStartTimestamp)) - { - writer.WritePropertyName("backupStartTimestamp"u8); - writer.WriteStringValue(BackupStartTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupStopTimestamp)) - { - writer.WritePropertyName("backupStopTimestamp"u8); - writer.WriteStringValue(BackupStopTimestamp.Value, "O"); - } - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - writer.WritePropertyName("backupExpiryTimestamp"u8); - writer.WriteStringValue(BackupExpiryTimestamp.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterBackupResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - - internal static CassandraClusterBackupResourceInfo DeserializeCassandraClusterBackupResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string backupId = default; - CassandraClusterBackupState? backupState = default; - DateTimeOffset? backupStartTimestamp = default; - DateTimeOffset? backupStopTimestamp = default; - DateTimeOffset? backupExpiryTimestamp = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("backupId"u8)) - { - backupId = property.Value.GetString(); - continue; - } - if (property.NameEquals("backupState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupState = new CassandraClusterBackupState(property.Value.GetString()); - continue; - } - if (property.NameEquals("backupStartTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStartTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupStopTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupStopTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("backupExpiryTimestamp"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - backupExpiryTimestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupResourceInfo( - backupId, - backupState, - backupStartTimestamp, - backupStopTimestamp, - backupExpiryTimestamp, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupId)) - { - builder.Append(" backupId: "); - if (BackupId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{BackupId}'''"); - } - else - { - builder.AppendLine($"'{BackupId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupState)) - { - builder.Append(" backupState: "); - builder.AppendLine($"'{BackupState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStartTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStartTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStartTimestamp)) - { - builder.Append(" backupStartTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStartTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupStopTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupStopTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupStopTimestamp)) - { - builder.Append(" backupStopTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupStopTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupExpiryTimestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupExpiryTimestamp: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(BackupExpiryTimestamp)) - { - builder.Append(" backupExpiryTimestamp: "); - var formattedDateTimeString = TypeFormatters.ToString(BackupExpiryTimestamp.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupResourceInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterBackupResourceInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs deleted file mode 100644 index 2fb86f9304e3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A restorable backup of a Cassandra cluster. - public partial class CassandraClusterBackupResourceInfo - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterBackupResourceInfo() - { - } - - /// Initializes a new instance of . - /// The unique identifier of backup. - /// The current state of the backup. - /// The time at which the backup process begins. - /// The time at which the backup process ends. - /// The time at which the backup will expire. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupResourceInfo(string backupId, CassandraClusterBackupState? backupState, DateTimeOffset? backupStartTimestamp, DateTimeOffset? backupStopTimestamp, DateTimeOffset? backupExpiryTimestamp, IDictionary serializedAdditionalRawData) - { - BackupId = backupId; - BackupState = backupState; - BackupStartTimestamp = backupStartTimestamp; - BackupStopTimestamp = backupStopTimestamp; - BackupExpiryTimestamp = backupExpiryTimestamp; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of backup. - [WirePath("backupId")] - public string BackupId { get; } - /// The current state of the backup. - [WirePath("backupState")] - public CassandraClusterBackupState? BackupState { get; } - /// The time at which the backup process begins. - [WirePath("backupStartTimestamp")] - public DateTimeOffset? BackupStartTimestamp { get; } - /// The time at which the backup process ends. - [WirePath("backupStopTimestamp")] - public DateTimeOffset? BackupStopTimestamp { get; } - /// The time at which the backup will expire. - [WirePath("backupExpiryTimestamp")] - public DateTimeOffset? BackupExpiryTimestamp { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs deleted file mode 100644 index 5312824b9616..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterBackupSchedule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(ScheduleName)) - { - writer.WritePropertyName("scheduleName"u8); - writer.WriteStringValue(ScheduleName); - } - if (Optional.IsDefined(CronExpression)) - { - writer.WritePropertyName("cronExpression"u8); - writer.WriteStringValue(CronExpression); - } - if (Optional.IsDefined(RetentionInHours)) - { - writer.WritePropertyName("retentionInHours"u8); - writer.WriteNumberValue(RetentionInHours.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterBackupSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - - internal static CassandraClusterBackupSchedule DeserializeCassandraClusterBackupSchedule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string scheduleName = default; - string cronExpression = default; - int? retentionInHours = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("scheduleName"u8)) - { - scheduleName = property.Value.GetString(); - continue; - } - if (property.NameEquals("cronExpression"u8)) - { - cronExpression = property.Value.GetString(); - continue; - } - if (property.NameEquals("retentionInHours"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - retentionInHours = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterBackupSchedule(scheduleName, cronExpression, retentionInHours, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduleName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduleName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduleName)) - { - builder.Append(" scheduleName: "); - if (ScheduleName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ScheduleName}'''"); - } - else - { - builder.AppendLine($"'{ScheduleName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CronExpression), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cronExpression: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CronExpression)) - { - builder.Append(" cronExpression: "); - if (CronExpression.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CronExpression}'''"); - } - else - { - builder.AppendLine($"'{CronExpression}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetentionInHours), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" retentionInHours: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RetentionInHours)) - { - builder.Append(" retentionInHours: "); - builder.AppendLine($"{RetentionInHours.Value}"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterBackupSchedule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterBackupSchedule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs deleted file mode 100644 index 82a98b5c58dc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraClusterBackupSchedule. - public partial class CassandraClusterBackupSchedule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CassandraClusterBackupSchedule() - { - } - - /// Initializes a new instance of . - /// The unique identifier of backup schedule. - /// The cron expression that defines when you want to back up your data. - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterBackupSchedule(string scheduleName, string cronExpression, int? retentionInHours, IDictionary serializedAdditionalRawData) - { - ScheduleName = scheduleName; - CronExpression = cronExpression; - RetentionInHours = retentionInHours; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of backup schedule. - [WirePath("scheduleName")] - public string ScheduleName { get; set; } - /// The cron expression that defines when you want to back up your data. - [WirePath("cronExpression")] - public string CronExpression { get; set; } - /// The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. - [WirePath("retentionInHours")] - public int? RetentionInHours { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs deleted file mode 100644 index e16cccd059f7..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The current state of the backup. - public readonly partial struct CassandraClusterBackupState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterBackupState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InitiatedValue = "Initiated"; - private const string InProgressValue = "InProgress"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - - /// Initiated. - public static CassandraClusterBackupState Initiated { get; } = new CassandraClusterBackupState(InitiatedValue); - /// InProgress. - public static CassandraClusterBackupState InProgress { get; } = new CassandraClusterBackupState(InProgressValue); - /// Succeeded. - public static CassandraClusterBackupState Succeeded { get; } = new CassandraClusterBackupState(SucceededValue); - /// Failed. - public static CassandraClusterBackupState Failed { get; } = new CassandraClusterBackupState(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterBackupState left, CassandraClusterBackupState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterBackupState left, CassandraClusterBackupState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterBackupState(string value) => new CassandraClusterBackupState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterBackupState other && Equals(other); - /// - public bool Equals(CassandraClusterBackupState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs deleted file mode 100644 index f1401c33c3ed..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraClusterCommand : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Command)) - { - writer.WritePropertyName("command"u8); - writer.WriteStringValue(Command); - } - if (Optional.IsDefined(CommandId)) - { - writer.WritePropertyName("commandId"u8); - writer.WriteStringValue(CommandId); - } - if (Optional.IsDefined(Arguments)) - { - writer.WritePropertyName("arguments"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Arguments); -#else - using (JsonDocument document = JsonDocument.Parse(Arguments)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - if (Optional.IsDefined(Host)) - { - writer.WritePropertyName("host"u8); - writer.WriteStringValue(Host); - } - if (Optional.IsDefined(IsAdmin)) - { - writer.WritePropertyName("isAdmin"u8); - writer.WriteBooleanValue(IsAdmin.Value); - } - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - writer.WritePropertyName("cassandraStopStart"u8); - writer.WriteBooleanValue(ShouldStopCassandraBeforeStart.Value); - } - if (Optional.IsDefined(IsReadWrite)) - { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(IsReadWrite.Value); - } - if (Optional.IsDefined(Result)) - { - writer.WritePropertyName("result"u8); - writer.WriteStringValue(Result); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(OutputFile)) - { - writer.WritePropertyName("outputFile"u8); - writer.WriteStringValue(OutputFile); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraClusterCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - - internal static CassandraClusterCommand DeserializeCassandraClusterCommand(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string command = default; - string commandId = default; - BinaryData arguments = default; - string host = default; - bool? isAdmin = default; - bool? cassandraStopStart = default; - bool? readWrite = default; - string result = default; - CassandraClusterCommandStatus? status = default; - string outputFile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("command"u8)) - { - command = property.Value.GetString(); - continue; - } - if (property.NameEquals("commandId"u8)) - { - commandId = property.Value.GetString(); - continue; - } - if (property.NameEquals("arguments"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - arguments = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("host"u8)) - { - host = property.Value.GetString(); - continue; - } - if (property.NameEquals("isAdmin"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isAdmin = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cassandraStopStart"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cassandraStopStart = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("readWrite"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - readWrite = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("result"u8)) - { - result = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new CassandraClusterCommandStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("outputFile"u8)) - { - outputFile = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraClusterCommand( - command, - commandId, - arguments, - host, - isAdmin, - cassandraStopStart, - readWrite, - result, - status, - outputFile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Command), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" command: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Command)) - { - builder.Append(" command: "); - if (Command.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Command}'''"); - } - else - { - builder.AppendLine($"'{Command}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CommandId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" commandId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CommandId)) - { - builder.Append(" commandId: "); - if (CommandId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CommandId}'''"); - } - else - { - builder.AppendLine($"'{CommandId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Arguments), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" arguments: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Arguments)) - { - builder.Append(" arguments: "); - builder.AppendLine($"'{Arguments.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" host: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Host)) - { - builder.Append(" host: "); - if (Host.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Host}'''"); - } - else - { - builder.AppendLine($"'{Host}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsAdmin), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isAdmin: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsAdmin)) - { - builder.Append(" isAdmin: "); - var boolValue = IsAdmin.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ShouldStopCassandraBeforeStart), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" cassandraStopStart: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ShouldStopCassandraBeforeStart)) - { - builder.Append(" cassandraStopStart: "); - var boolValue = ShouldStopCassandraBeforeStart.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsReadWrite), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" readWrite: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsReadWrite)) - { - builder.Append(" readWrite: "); - var boolValue = IsReadWrite.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Result), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" result: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Result)) - { - builder.Append(" result: "); - if (Result.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Result}'''"); - } - else - { - builder.AppendLine($"'{Result}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - builder.AppendLine($"'{Status.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputFile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" outputFile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(OutputFile)) - { - builder.Append(" outputFile: "); - if (OutputFile.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{OutputFile}'''"); - } - else - { - builder.AppendLine($"'{OutputFile}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{options.Format}' format."); - } - } - - CassandraClusterCommand IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraClusterCommand(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs deleted file mode 100644 index 698500131c28..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// resource representing a command. - public partial class CassandraClusterCommand - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraClusterCommand() - { - } - - /// Initializes a new instance of . - /// The command which should be run. - /// The unique id of command. - /// The arguments for the command to be run. - /// IP address of the cassandra host to run the command on. - /// Whether command has admin privileges. - /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - /// Result output of the command. - /// Status of the command. - /// The name of the file where the result is written. - /// Keeps track of any properties unknown to the library. - internal CassandraClusterCommand(string command, string commandId, BinaryData arguments, string host, bool? isAdmin, bool? shouldStopCassandraBeforeStart, bool? isReadWrite, string result, CassandraClusterCommandStatus? status, string outputFile, IDictionary serializedAdditionalRawData) - { - Command = command; - CommandId = commandId; - Arguments = arguments; - Host = host; - IsAdmin = isAdmin; - ShouldStopCassandraBeforeStart = shouldStopCassandraBeforeStart; - IsReadWrite = isReadWrite; - Result = result; - Status = status; - OutputFile = outputFile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The command which should be run. - [WirePath("command")] - public string Command { get; } - /// The unique id of command. - [WirePath("commandId")] - public string CommandId { get; } - /// - /// The arguments for the command to be run - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - [WirePath("arguments")] - public BinaryData Arguments { get; } - /// IP address of the cassandra host to run the command on. - [WirePath("host")] - public string Host { get; } - /// Whether command has admin privileges. - [WirePath("isAdmin")] - public bool? IsAdmin { get; } - /// If true, stops cassandra before executing the command and then start it again. - [WirePath("cassandraStopStart")] - public bool? ShouldStopCassandraBeforeStart { get; } - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? IsReadWrite { get; } - /// Result output of the command. - [WirePath("result")] - public string Result { get; } - /// Status of the command. - [WirePath("status")] - public CassandraClusterCommandStatus? Status { get; } - /// The name of the file where the result is written. - [WirePath("outputFile")] - public string OutputFile { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs deleted file mode 100644 index 18d1f271a6f3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommandStatus.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Status of the command. - public readonly partial struct CassandraClusterCommandStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterCommandStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DoneValue = "Done"; - private const string RunningValue = "Running"; - private const string EnqueueValue = "Enqueue"; - private const string ProcessingValue = "Processing"; - private const string FinishedValue = "Finished"; - private const string FailedValue = "Failed"; - - /// Done. - public static CassandraClusterCommandStatus Done { get; } = new CassandraClusterCommandStatus(DoneValue); - /// Running. - public static CassandraClusterCommandStatus Running { get; } = new CassandraClusterCommandStatus(RunningValue); - /// Enqueue. - public static CassandraClusterCommandStatus Enqueue { get; } = new CassandraClusterCommandStatus(EnqueueValue); - /// Processing. - public static CassandraClusterCommandStatus Processing { get; } = new CassandraClusterCommandStatus(ProcessingValue); - /// Finished. - public static CassandraClusterCommandStatus Finished { get; } = new CassandraClusterCommandStatus(FinishedValue); - /// Failed. - public static CassandraClusterCommandStatus Failed { get; } = new CassandraClusterCommandStatus(FailedValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterCommandStatus left, CassandraClusterCommandStatus right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterCommandStatus(string value) => new CassandraClusterCommandStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterCommandStatus other && Equals(other); - /// - public bool Equals(CassandraClusterCommandStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs index 41539485aace..7f605b3ac4f1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs @@ -118,11 +118,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("cpuUsage"u8); writer.WriteNumberValue(CpuUsage.Value); } - if (Optional.IsDefined(IsLatestModel)) - { - writer.WritePropertyName("isLatestModel"u8); - writer.WriteBooleanValue(IsLatestModel.Value); - } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -178,7 +173,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa long? memoryFreeKB = default; long? memoryTotalKB = default; double? cpuUsage = default; - bool? isLatestModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -317,15 +311,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa cpuUsage = property.Value.GetDouble(); continue; } - if (property.NameEquals("isLatestModel"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isLatestModel = property.Value.GetBoolean(); - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -350,7 +335,6 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa memoryFreeKB, memoryTotalKB, cpuUsage, - isLatestModel, serializedAdditionalRawData); } @@ -689,22 +673,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsLatestModel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" isLatestModel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IsLatestModel)) - { - builder.Append(" isLatestModel: "); - var boolValue = IsLatestModel.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs index dba03dd08080..3932357b3057 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs @@ -69,9 +69,8 @@ internal CassandraClusterDataCenterNodeItem() /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - /// If node has been updated to latest model. /// Keeps track of any properties unknown to the library. - internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, bool? isLatestModel, IDictionary serializedAdditionalRawData) + internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage, IDictionary serializedAdditionalRawData) { Address = address; State = state; @@ -90,7 +89,6 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? MemoryFreeKB = memoryFreeKB; MemoryTotalKB = memoryTotalKB; CpuUsage = cpuUsage; - IsLatestModel = isLatestModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -145,8 +143,5 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? /// A float representing the current system-wide CPU utilization as a percentage. [WirePath("cpuUsage")] public double? CpuUsage { get; } - /// If node has been updated to latest model. - [WirePath("isLatestModel")] - public bool? IsLatestModel { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs index 477cf23bd823..a6be600e1375 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs @@ -73,11 +73,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("repairEnabled"u8); writer.WriteBooleanValue(IsRepairEnabled.Value); } - if (Optional.IsDefined(AutoReplicate)) - { - writer.WritePropertyName("autoReplicate"u8); - writer.WriteStringValue(AutoReplicate.Value.ToString()); - } if (Optional.IsCollectionDefined(ClientCertificates)) { writer.WritePropertyName("clientCertificates"u8); @@ -128,16 +123,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - writer.WritePropertyName("externalDataCenters"u8); - writer.WriteStartArray(); - foreach (var item in ExternalDataCenters) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } if (Optional.IsDefined(HoursBetweenBackups)) { writer.WritePropertyName("hoursBetweenBackups"u8); @@ -153,41 +138,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("cassandraAuditLoggingEnabled"u8); writer.WriteBooleanValue(IsCassandraAuditLoggingEnabled.Value); } - if (Optional.IsDefined(ClusterType)) - { - writer.WritePropertyName("clusterType"u8); - writer.WriteStringValue(ClusterType.Value.ToString()); - } if (Optional.IsDefined(ProvisionError)) { writer.WritePropertyName("provisionError"u8); writer.WriteObjectValue(ProvisionError, options); } - if (Optional.IsCollectionDefined(Extensions)) - { - writer.WritePropertyName("extensions"u8); - writer.WriteStartArray(); - foreach (var item in Extensions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(BackupSchedules)) - { - writer.WritePropertyName("backupSchedules"u8); - writer.WriteStartArray(); - foreach (var item in BackupSchedules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ScheduledEventStrategy)) - { - writer.WritePropertyName("scheduledEventStrategy"u8); - writer.WriteStringValue(ScheduledEventStrategy.Value.ToString()); - } if (Optional.IsDefined(AzureConnectionMethod)) { writer.WritePropertyName("azureConnectionMethod"u8); @@ -245,21 +200,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties string initialCassandraAdminPassword = default; CassandraDataCenterSeedNode prometheusEndpoint = default; bool? repairEnabled = default; - CassandraAutoReplicateForm? autoReplicate = default; IList clientCertificates = default; IList externalGossipCertificates = default; IReadOnlyList gossipCertificates = default; IList externalSeedNodes = default; IReadOnlyList seedNodes = default; - IList externalDataCenters = default; int? hoursBetweenBackups = default; bool? deallocated = default; bool? cassandraAuditLoggingEnabled = default; - CassandraClusterType? clusterType = default; CassandraError provisionError = default; - IList extensions = default; - IList backupSchedules = default; - ScheduledEventStrategy? scheduledEventStrategy = default; ServiceConnectionType? azureConnectionMethod = default; ResourceIdentifier privateLinkResourceId = default; IDictionary serializedAdditionalRawData = default; @@ -331,15 +280,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties repairEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("autoReplicate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoReplicate = new CassandraAutoReplicateForm(property.Value.GetString()); - continue; - } if (property.NameEquals("clientCertificates"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -410,20 +350,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties seedNodes = array; continue; } - if (property.NameEquals("externalDataCenters"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - externalDataCenters = array; - continue; - } if (property.NameEquals("hoursBetweenBackups"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -451,15 +377,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties cassandraAuditLoggingEnabled = property.Value.GetBoolean(); continue; } - if (property.NameEquals("clusterType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clusterType = new CassandraClusterType(property.Value.GetString()); - continue; - } if (property.NameEquals("provisionError"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -469,43 +386,6 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties provisionError = CassandraError.DeserializeCassandraError(property.Value, options); continue; } - if (property.NameEquals("extensions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - extensions = array; - continue; - } - if (property.NameEquals("backupSchedules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupSchedule.DeserializeCassandraClusterBackupSchedule(item, options)); - } - backupSchedules = array; - continue; - } - if (property.NameEquals("scheduledEventStrategy"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scheduledEventStrategy = new ScheduledEventStrategy(property.Value.GetString()); - continue; - } if (property.NameEquals("azureConnectionMethod"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -540,21 +420,15 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties initialCassandraAdminPassword, prometheusEndpoint, repairEnabled, - autoReplicate, clientCertificates ?? new ChangeTrackingList(), externalGossipCertificates ?? new ChangeTrackingList(), gossipCertificates ?? new ChangeTrackingList(), externalSeedNodes ?? new ChangeTrackingList(), seedNodes ?? new ChangeTrackingList(), - externalDataCenters ?? new ChangeTrackingList(), hoursBetweenBackups, deallocated, cassandraAuditLoggingEnabled, - clusterType, provisionError, - extensions ?? new ChangeTrackingList(), - backupSchedules ?? new ChangeTrackingList(), - scheduledEventStrategy, azureConnectionMethod, privateLinkResourceId, serializedAdditionalRawData); @@ -742,21 +616,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoReplicate), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoReplicate: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AutoReplicate)) - { - builder.Append(" autoReplicate: "); - builder.AppendLine($"'{AutoReplicate.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientCertificates), out propertyOverride); if (hasPropertyOverride) { @@ -872,42 +731,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExternalDataCenters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ExternalDataCenters)) - { - if (ExternalDataCenters.Any()) - { - builder.Append(" externalDataCenters: "); - builder.AppendLine("["); - foreach (var item in ExternalDataCenters) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HoursBetweenBackups), out propertyOverride); if (hasPropertyOverride) { @@ -955,21 +778,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClusterType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" clusterType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ClusterType)) - { - builder.Append(" clusterType: "); - builder.AppendLine($"'{ClusterType.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisionError), out propertyOverride); if (hasPropertyOverride) { @@ -985,80 +793,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Extensions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" extensions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Extensions)) - { - if (Extensions.Any()) - { - builder.Append(" extensions: "); - builder.AppendLine("["); - foreach (var item in Extensions) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BackupSchedules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" backupSchedules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(BackupSchedules)) - { - if (BackupSchedules.Any()) - { - builder.Append(" backupSchedules: "); - builder.AppendLine("["); - foreach (var item in BackupSchedules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " backupSchedules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledEventStrategy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScheduledEventStrategy)) - { - builder.Append(" scheduledEventStrategy: "); - builder.AppendLine($"'{ScheduledEventStrategy.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureConnectionMethod), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs index ee65e9f38870..75291438ae06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs @@ -54,9 +54,6 @@ public CassandraClusterProperties() GossipCertificates = new ChangeTrackingList(); ExternalSeedNodes = new ChangeTrackingList(); SeedNodes = new ChangeTrackingList(); - ExternalDataCenters = new ChangeTrackingList(); - Extensions = new ChangeTrackingList(); - BackupSchedules = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -69,25 +66,19 @@ public CassandraClusterProperties() /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. - /// The form of AutoReplicate that is being used by this cluster. /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. /// List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. /// Error related to resource provisioning. - /// Extensions to be added or updated on cluster. - /// List of backup schedules that define when you want to back up your data. - /// How the nodes in the cluster react to scheduled events. /// How to connect to the azure services needed for running the cluster. - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. /// Keeps track of any properties unknown to the library. - internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, CassandraAutoReplicateForm? autoReplicate, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, IList externalDataCenters, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraClusterType? clusterType, CassandraError provisionError, IList extensions, IList backupSchedules, ScheduledEventStrategy? scheduledEventStrategy, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) + internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraError provisionError, ServiceConnectionType? azureConnectionMethod, ResourceIdentifier privateLinkResourceId, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; RestoreFromBackupId = restoreFromBackupId; @@ -98,21 +89,15 @@ internal CassandraClusterProperties(CassandraProvisioningState? provisioningStat InitialCassandraAdminPassword = initialCassandraAdminPassword; PrometheusEndpoint = prometheusEndpoint; IsRepairEnabled = isRepairEnabled; - AutoReplicate = autoReplicate; ClientCertificates = clientCertificates; ExternalGossipCertificates = externalGossipCertificates; GossipCertificates = gossipCertificates; ExternalSeedNodes = externalSeedNodes; SeedNodes = seedNodes; - ExternalDataCenters = externalDataCenters; HoursBetweenBackups = hoursBetweenBackups; IsDeallocated = isDeallocated; IsCassandraAuditLoggingEnabled = isCassandraAuditLoggingEnabled; - ClusterType = clusterType; ProvisionError = provisionError; - Extensions = extensions; - BackupSchedules = backupSchedules; - ScheduledEventStrategy = scheduledEventStrategy; AzureConnectionMethod = azureConnectionMethod; PrivateLinkResourceId = privateLinkResourceId; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -157,9 +142,6 @@ public string PrometheusEndpointIPAddress /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. [WirePath("repairEnabled")] public bool? IsRepairEnabled { get; set; } - /// The form of AutoReplicate that is being used by this cluster. - [WirePath("autoReplicate")] - public CassandraAutoReplicateForm? AutoReplicate { get; set; } /// List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. [WirePath("clientCertificates")] public IList ClientCertificates { get; } @@ -175,9 +157,6 @@ public string PrometheusEndpointIPAddress /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. [WirePath("seedNodes")] public IReadOnlyList SeedNodes { get; } - /// List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. - [WirePath("externalDataCenters")] - public IList ExternalDataCenters { get; } /// (Deprecated) Number of hours to wait between taking a backup of the cluster. [WirePath("hoursBetweenBackups")] public int? HoursBetweenBackups { get; set; } @@ -187,25 +166,13 @@ public string PrometheusEndpointIPAddress /// Whether Cassandra audit logging is enabled. [WirePath("cassandraAuditLoggingEnabled")] public bool? IsCassandraAuditLoggingEnabled { get; set; } - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - [WirePath("clusterType")] - public CassandraClusterType? ClusterType { get; set; } /// Error related to resource provisioning. [WirePath("provisionError")] public CassandraError ProvisionError { get; set; } - /// Extensions to be added or updated on cluster. - [WirePath("extensions")] - public IList Extensions { get; } - /// List of backup schedules that define when you want to back up your data. - [WirePath("backupSchedules")] - public IList BackupSchedules { get; } - /// How the nodes in the cluster react to scheduled events. - [WirePath("scheduledEventStrategy")] - public ScheduledEventStrategy? ScheduledEventStrategy { get; set; } /// How to connect to the azure services needed for running the cluster. [WirePath("azureConnectionMethod")] public ServiceConnectionType? AzureConnectionMethod { get; set; } - /// If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. + /// If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. [WirePath("privateLinkResourceId")] public ResourceIdentifier PrivateLinkResourceId { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs deleted file mode 100644 index 08dbc03f6414..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of the cluster. If set to Production, some operations might not be permitted on cluster. - public readonly partial struct CassandraClusterType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CassandraClusterType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ProductionValue = "Production"; - private const string NonProductionValue = "NonProduction"; - - /// Production. - public static CassandraClusterType Production { get; } = new CassandraClusterType(ProductionValue); - /// NonProduction. - public static CassandraClusterType NonProduction { get; } = new CassandraClusterType(NonProductionValue); - /// Determines if two values are the same. - public static bool operator ==(CassandraClusterType left, CassandraClusterType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CassandraClusterType left, CassandraClusterType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CassandraClusterType(string value) => new CassandraClusterType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CassandraClusterType other && Equals(other); - /// - public bool Equals(CassandraClusterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs index 58ba02e0e5a9..ba0baea24975 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs @@ -46,10 +46,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WritePropertyName("cassandra-stop-start"u8); writer.WriteBooleanValue(CassandraStopStart.Value); } - if (Optional.IsDefined(AllowWrite)) + if (Optional.IsDefined(Readwrite)) { - writer.WritePropertyName("readWrite"u8); - writer.WriteBooleanValue(AllowWrite.Value); + writer.WritePropertyName("readwrite"u8); + writer.WriteBooleanValue(Readwrite.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -93,7 +93,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso IDictionary arguments = default; string host = default; bool? cassandraStopStart = default; - bool? readWrite = default; + bool? readwrite = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,13 +131,13 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso cassandraStopStart = property.Value.GetBoolean(); continue; } - if (property.NameEquals("readWrite"u8)) + if (property.NameEquals("readwrite"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - readWrite = property.Value.GetBoolean(); + readwrite = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -151,7 +151,7 @@ internal static CassandraCommandPostBody DeserializeCassandraCommandPostBody(Jso arguments ?? new ChangeTrackingDictionary(), host, cassandraStopStart, - readWrite, + readwrite, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs index f1a30a528624..cbc35ba4c830 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.cs @@ -64,15 +64,15 @@ public CassandraCommandPostBody(string command, string host) /// The arguments for the command to be run. /// IP address of the cassandra host to run the command on. /// If true, stops cassandra before executing the command and then start it again. - /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. + /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. /// Keeps track of any properties unknown to the library. - internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? allowWrite, IDictionary serializedAdditionalRawData) + internal CassandraCommandPostBody(string command, IDictionary arguments, string host, bool? cassandraStopStart, bool? readwrite, IDictionary serializedAdditionalRawData) { Command = command; Arguments = arguments; Host = host; CassandraStopStart = cassandraStopStart; - AllowWrite = allowWrite; + Readwrite = readwrite; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,7 +94,7 @@ internal CassandraCommandPostBody() [WirePath("cassandra-stop-start")] public bool? CassandraStopStart { get; set; } /// If true, allows the command to *write* to the cassandra directory, otherwise read-only. - [WirePath("readWrite")] - public bool? AllowWrite { get; set; } + [WirePath("readwrite")] + public bool? Readwrite { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs index 6e1f2937fc84..5ef07834a583 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CassandraKeyspaceCreateOrUpdateContent DeserializeCassandraKeysp location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs index 6820de815f52..b76fc6bec344 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraKeyspaceCreateOrUpdateContent(AzureLocation location, CassandraK /// The location. /// The standard JSON format of a Cassandra keyspace. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraKeyspaceCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraKeyspaceResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -95,8 +93,5 @@ public string ResourceKeyspaceName /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs index 1ae0e1ea253a..ee7d6a813c04 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CassandraTableCreateOrUpdateContent DeserializeCassandraTableCre location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs index 2605da0abfae..5235cd0d4f83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CassandraTableCreateOrUpdateContent(AzureLocation location, CassandraTabl /// The location. /// The standard JSON format of a Cassandra table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CassandraTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CassandraTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs deleted file mode 100644 index f8540c148381..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesOptions DeserializeCassandraViewGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs deleted file mode 100644 index 592a376d7a9f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesOptions. - public partial class CassandraViewGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public CassandraViewGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs deleted file mode 100644 index 66002ffbc000..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Rid)) - { - writer.WritePropertyName("_rid"u8); - writer.WriteStringValue(Rid); - } - if (options.Format != "W" && Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("_ts"u8); - writer.WriteNumberValue(Timestamp.Value); - } - if (options.Format != "W" && Optional.IsDefined(ETag)) - { - writer.WritePropertyName("_etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - - internal static CassandraViewGetPropertiesResource DeserializeCassandraViewGetPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string rid = default; - float? ts = default; - ETag? etag = default; - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("_rid"u8)) - { - rid = property.Value.GetString(); - continue; - } - if (property.NameEquals("_ts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - ts = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("_etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetPropertiesResource( - id, - viewDefinition, - serializedAdditionalRawData, - rid, - ts, - etag); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _rid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Rid)) - { - builder.Append(" _rid: "); - if (Rid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Rid}'''"); - } - else - { - builder.AppendLine($"'{Rid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _ts: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Timestamp)) - { - builder.Append(" _ts: "); - builder.AppendLine($"'{Timestamp.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" _etag: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ETag)) - { - builder.Append(" _etag: "); - builder.AppendLine($"'{ETag.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs deleted file mode 100644 index 9b83c445f7b3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The CassandraViewGetPropertiesResource. - public partial class CassandraViewGetPropertiesResource : CassandraViewResource - { - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewGetPropertiesResource(string id, string viewDefinition) : base(id, viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - /// A system generated property. A unique identifier. - /// A system generated property that denotes the last updated timestamp of the resource. - /// A system generated property representing the resource etag required for optimistic concurrency control. - internal CassandraViewGetPropertiesResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(id, viewDefinition, serializedAdditionalRawData) - { - Rid = rid; - Timestamp = timestamp; - ETag = etag; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetPropertiesResource() - { - } - - /// A system generated property. A unique identifier. - [WirePath("_rid")] - public string Rid { get; } - /// A system generated property that denotes the last updated timestamp of the resource. - [WirePath("_ts")] - public float? Timestamp { get; } - /// A system generated property representing the resource etag required for optimistic concurrency control. - [WirePath("_etag")] - public ETag? ETag { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index a7faa3184ab9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static CassandraViewGetResultCreateOrUpdateContent DeserializeCassandraViewGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - CassandraViewResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = CassandraViewResource.DeserializeCassandraViewResource(property0.Value, options); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs deleted file mode 100644 index 69d2c56c0064..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Cassandra view. - public partial class CassandraViewGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Cassandra view. - /// is null. - public CassandraViewGetResultCreateOrUpdateContent(AzureLocation location, CassandraViewResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Cassandra view. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal CassandraViewGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CassandraViewResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Cassandra view. - [WirePath("properties.resource")] - public CassandraViewResource Resource { get; set; } - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs deleted file mode 100644 index f6147d64a37b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class CassandraViewListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - - internal static CassandraViewListResult DeserializeCassandraViewListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraViewGetResultData.DeserializeCassandraViewGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs deleted file mode 100644 index 35fd26a8643c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Cassandra views and their properties. - internal partial class CassandraViewListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CassandraViewListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Cassandra views and their properties. - /// Keeps track of any properties unknown to the library. - internal CassandraViewListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Cassandra views and their properties. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs deleted file mode 100644 index dce1d590180d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CassandraViewResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CassandraViewResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCassandraViewResource(document.RootElement, options); - } - - internal static CassandraViewResource DeserializeCassandraViewResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string viewDefinition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("viewDefinition"u8)) - { - viewDefinition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CassandraViewResource(id, viewDefinition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" viewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ViewDefinition)) - { - builder.Append(" viewDefinition: "); - if (ViewDefinition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ViewDefinition}'''"); - } - else - { - builder.AppendLine($"'{ViewDefinition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{options.Format}' format."); - } - } - - CassandraViewResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCassandraViewResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CassandraViewResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs deleted file mode 100644 index 00b0c796b103..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB Cassandra view resource object. - public partial class CassandraViewResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// or is null. - public CassandraViewResource(string id, string viewDefinition) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(viewDefinition, nameof(viewDefinition)); - - Id = id; - ViewDefinition = viewDefinition; - } - - /// Initializes a new instance of . - /// Name of the Cosmos DB Cassandra view. - /// View Definition of the Cosmos DB Cassandra view. - /// Keeps track of any properties unknown to the library. - internal CassandraViewResource(string id, string viewDefinition, IDictionary serializedAdditionalRawData) - { - Id = id; - ViewDefinition = viewDefinition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CassandraViewResource() - { - } - - /// Name of the Cosmos DB Cassandra view. - [WirePath("id")] - public string Id { get; set; } - /// View Definition of the Cosmos DB Cassandra view. - [WirePath("viewDefinition")] - public string ViewDefinition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs index 30b994436d03..692a02f725ea 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs @@ -32,7 +32,7 @@ internal ContinuousModeBackupPolicy(BackupPolicyType backupPolicyType, BackupPol /// Configuration values for continuous mode backup. internal ContinuousModeProperties ContinuousModeProperties { get; set; } - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("continuousModeProperties.tier")] public ContinuousTier? ContinuousModeTier { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs index 6ba0eb1d606e..a8e3f277570d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.cs @@ -51,7 +51,7 @@ public ContinuousModeProperties() } /// Initializes a new instance of . - /// Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. /// Keeps track of any properties unknown to the library. internal ContinuousModeProperties(ContinuousTier? tier, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal ContinuousModeProperties(ContinuousTier? tier, IDictionary Enum to indicate type of Continuos backup mode. + /// Enum to indicate type of Continuous backup mode. [WirePath("tier")] public ContinuousTier? Tier { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 8a8a6a3ad091..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosCassandraDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("keyspaceName"u8); - writer.WriteStringValue(KeyspaceName); - writer.WritePropertyName("tableName"u8); - writer.WriteStringValue(TableName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosCassandraDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosCassandraDataTransferDataSourceSink DeserializeCosmosCassandraDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string keyspaceName = default; - string tableName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("keyspaceName"u8)) - { - keyspaceName = property.Value.GetString(); - continue; - } - if (property.NameEquals("tableName"u8)) - { - tableName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosCassandraDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, keyspaceName, tableName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyspaceName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" keyspaceName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(KeyspaceName)) - { - builder.Append(" keyspaceName: "); - if (KeyspaceName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{KeyspaceName}'''"); - } - else - { - builder.AppendLine($"'{KeyspaceName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TableName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tableName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TableName)) - { - builder.Append(" tableName: "); - if (TableName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{TableName}'''"); - } - else - { - builder.AppendLine($"'{TableName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosCassandraDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosCassandraDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs deleted file mode 100644 index f915006de849..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Cassandra API data source/sink. - public partial class CosmosCassandraDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) - { - Argument.AssertNotNull(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNull(tableName, nameof(tableName)); - - KeyspaceName = keyspaceName; - TableName = tableName; - Component = DataTransferComponent.CosmosDBCassandra; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosCassandraDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string keyspaceName, string tableName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - KeyspaceName = keyspaceName; - TableName = tableName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosCassandraDataTransferDataSourceSink() - { - } - - /// Gets or sets the keyspace name. - [WirePath("keyspaceName")] - public string KeyspaceName { get; set; } - /// Gets or sets the table name. - [WirePath("tableName")] - public string TableName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs index e46744332f7c..708b026d0cc7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs @@ -224,11 +224,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -244,16 +239,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -264,31 +249,21 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -365,19 +340,14 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountRestoreParameters restoreParameters = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -695,15 +665,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -731,24 +692,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -767,15 +710,6 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -785,27 +719,18 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -834,6 +759,7 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC tags ?? new ChangeTrackingDictionary(), location, kind, + identity, consistencyPolicy, locations, databaseAccountOfferType, @@ -858,21 +784,15 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, restoreParameters, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, - identity, serializedAdditionalRawData); } @@ -1456,26 +1376,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiagnosticLogEnableFullTextQuery", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticLogSettings: "); - builder.AppendLine("{"); - builder.AppendLine(" diagnosticLogSettings: {"); - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(DiagnosticLogSettings)) - { - builder.Append(" diagnosticLogSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, DiagnosticLogSettings, options, 4, false, " diagnosticLogSettings: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisableLocalAuth), out propertyOverride); if (hasPropertyOverride) { @@ -1527,37 +1427,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapacityMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" capacityMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CapacityMode)) - { - builder.Append(" capacityMode: "); - builder.AppendLine($"'{CapacityMode.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMaterializedViews), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableMaterializedViews: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableMaterializedViews)) - { - builder.Append(" enableMaterializedViews: "); - var boolValue = EnableMaterializedViews.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeysMetadata), out propertyOverride); if (hasPropertyOverride) { @@ -1589,34 +1458,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableBurstCapacity: "); + builder.Append(" minimalTlsVersion: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableBurstCapacity)) + if (Optional.IsDefined(MinimalTlsVersion)) { - builder.Append(" enableBurstCapacity: "); - var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.Append(" minimalTlsVersion: "); + builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinimalTlsVersion), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableBurstCapacity), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" minimalTlsVersion: "); + builder.Append(" enableBurstCapacity: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(MinimalTlsVersion)) + if (Optional.IsDefined(EnableBurstCapacity)) { - builder.Append(" minimalTlsVersion: "); - builder.AppendLine($"'{MinimalTlsVersion.Value.ToString()}'"); + builder.Append(" enableBurstCapacity: "); + var boolValue = EnableBurstCapacity.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); } } @@ -1643,37 +1512,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePriorityBasedExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enablePriorityBasedExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - builder.Append(" enablePriorityBasedExecution: "); - var boolValue = EnablePriorityBasedExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultPriorityLevel), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DefaultPriorityLevel)) - { - builder.Append(" defaultPriorityLevel: "); - builder.AppendLine($"'{DefaultPriorityLevel.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnablePerRegionPerPartitionAutoscale), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs index 6c115e78bc8e..bffc11a22f56 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs @@ -73,6 +73,7 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The tags. /// The location. /// Indicates the type of database account. This can only be set at database account creation. + /// Identity for the resource. /// The consistency policy for the Cosmos DB account. /// An array that contains the georeplication locations enabled for the Cosmos DB account. /// The offer type for the database. @@ -101,25 +102,20 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Parameters to indicate the information about the restore. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. - /// Identity for the resource. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; + Identity = identity; ConsistencyPolicy = consistencyPolicy; Locations = locations; DatabaseAccountOfferType = databaseAccountOfferType; @@ -144,21 +140,15 @@ internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; RestoreParameters = restoreParameters; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -170,6 +160,9 @@ internal CosmosDBAccountCreateOrUpdateContent() /// Indicates the type of database account. This can only be set at database account creation. [WirePath("kind")] public CosmosDBAccountKind? Kind { get; set; } + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } /// The consistency policy for the Cosmos DB account. [WirePath("properties.consistencyPolicy")] public ConsistencyPolicy ConsistencyPolicy { get; set; } @@ -217,7 +210,7 @@ internal CosmosDBAccountCreateOrUpdateContent() public bool? IsFreeTierEnabled { get; set; } /// API specific properties. Currently, supported only for MongoDB API. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -267,21 +260,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -303,38 +281,23 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 8112c3ba607c..34ee207a14e7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs @@ -196,11 +196,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteEndArray(); } - if (Optional.IsDefined(DiagnosticLogSettings)) - { - writer.WritePropertyName("diagnosticLogSettings"u8); - writer.WriteObjectValue(DiagnosticLogSettings, options); - } if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); @@ -211,16 +206,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); } - if (Optional.IsDefined(CapacityMode)) - { - writer.WritePropertyName("capacityMode"u8); - writer.WriteStringValue(CapacityMode.Value.ToString()); - } - if (Optional.IsDefined(EnableMaterializedViews)) - { - writer.WritePropertyName("enableMaterializedViews"u8); - writer.WriteBooleanValue(EnableMaterializedViews.Value); - } if (options.Format != "W" && Optional.IsDefined(KeysMetadata)) { writer.WritePropertyName("keysMetadata"u8); @@ -231,31 +216,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("enablePartitionMerge"u8); writer.WriteBooleanValue(EnablePartitionMerge.Value); } - if (Optional.IsDefined(EnableBurstCapacity)) - { - writer.WritePropertyName("enableBurstCapacity"u8); - writer.WriteBooleanValue(EnableBurstCapacity.Value); - } if (Optional.IsDefined(MinimalTlsVersion)) { writer.WritePropertyName("minimalTlsVersion"u8); writer.WriteStringValue(MinimalTlsVersion.Value.ToString()); } + if (Optional.IsDefined(EnableBurstCapacity)) + { + writer.WritePropertyName("enableBurstCapacity"u8); + writer.WriteBooleanValue(EnableBurstCapacity.Value); + } if (Optional.IsDefined(CustomerManagedKeyStatus)) { writer.WritePropertyName("customerManagedKeyStatus"u8); writer.WriteStringValue(CustomerManagedKeyStatus); } - if (Optional.IsDefined(EnablePriorityBasedExecution)) - { - writer.WritePropertyName("enablePriorityBasedExecution"u8); - writer.WriteBooleanValue(EnablePriorityBasedExecution.Value); - } - if (Optional.IsDefined(DefaultPriorityLevel)) - { - writer.WritePropertyName("defaultPriorityLevel"u8); - writer.WriteStringValue(DefaultPriorityLevel.Value.ToString()); - } if (Optional.IsDefined(EnablePerRegionPerPartitionAutoscale)) { writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); @@ -325,18 +300,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement IList cors = default; NetworkAclBypass? networkAclBypass = default; IList networkAclBypassResourceIds = default; - DiagnosticLogSettings diagnosticLogSettings = default; bool? disableLocalAuth = default; CosmosDBAccountCapacity capacity = default; - CapacityMode? capacityMode = default; - bool? enableMaterializedViews = default; DatabaseAccountKeysMetadata keysMetadata = default; bool? enablePartitionMerge = default; - bool? enableBurstCapacity = default; CosmosDBMinimalTlsVersion? minimalTlsVersion = default; + bool? enableBurstCapacity = default; string customerManagedKeyStatus = default; - bool? enablePriorityBasedExecution = default; - DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -615,15 +585,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement networkAclBypassResourceIds = array; continue; } - if (property0.NameEquals("diagnosticLogSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticLogSettings = DiagnosticLogSettings.DeserializeDiagnosticLogSettings(property0.Value, options); - continue; - } if (property0.NameEquals("disableLocalAuth"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -642,24 +603,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement capacity = CosmosDBAccountCapacity.DeserializeCosmosDBAccountCapacity(property0.Value, options); continue; } - if (property0.NameEquals("capacityMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - capacityMode = new CapacityMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("enableMaterializedViews"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableMaterializedViews = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("keysMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -678,15 +621,6 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement enablePartitionMerge = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("enableBurstCapacity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableBurstCapacity = property0.Value.GetBoolean(); - continue; - } if (property0.NameEquals("minimalTlsVersion"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -696,27 +630,18 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement minimalTlsVersion = new CosmosDBMinimalTlsVersion(property0.Value.GetString()); continue; } - if (property0.NameEquals("customerManagedKeyStatus"u8)) - { - customerManagedKeyStatus = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("enablePriorityBasedExecution"u8)) + if (property0.NameEquals("enableBurstCapacity"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enablePriorityBasedExecution = property0.Value.GetBoolean(); + enableBurstCapacity = property0.Value.GetBoolean(); continue; } - if (property0.NameEquals("defaultPriorityLevel"u8)) + if (property0.NameEquals("customerManagedKeyStatus"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - defaultPriorityLevel = new DefaultPriorityLevel(property0.Value.GetString()); + customerManagedKeyStatus = property0.Value.GetString(); continue; } if (property0.NameEquals("enablePerRegionPerPartitionAutoscale"u8)) @@ -763,18 +688,13 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement cors ?? new ChangeTrackingList(), networkAclBypass, networkAclBypassResourceIds ?? new ChangeTrackingList(), - diagnosticLogSettings, disableLocalAuth, capacity, - capacityMode, - enableMaterializedViews, keysMetadata, enablePartitionMerge, - enableBurstCapacity, minimalTlsVersion, + enableBurstCapacity, customerManagedKeyStatus, - enablePriorityBasedExecution, - defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs index 7ad706668b4e..7b24aef45701 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs @@ -89,21 +89,16 @@ public CosmosDBAccountPatch() /// The CORS policy for the Cosmos DB database account. /// Indicates what services are allowed to bypass firewall checks. /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The object that represents all properties related to capacity enforcement on an account. - /// Indicates the capacityMode of the Cosmos DB account. - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. /// Flag to indicate enabling/disabling of Partition Merge feature on the account. - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - /// Enum to indicate default Priority Level of request for Priority Based Execution. - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) + internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, CosmosDBMinimalTlsVersion? minimalTlsVersion, bool? enableBurstCapacity, string customerManagedKeyStatus, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) { Tags = tags; Location = location; @@ -130,18 +125,13 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l Cors = cors; NetworkAclBypass = networkAclBypass; NetworkAclBypassResourceIds = networkAclBypassResourceIds; - DiagnosticLogSettings = diagnosticLogSettings; DisableLocalAuth = disableLocalAuth; Capacity = capacity; - CapacityMode = capacityMode; - EnableMaterializedViews = enableMaterializedViews; KeysMetadata = keysMetadata; EnablePartitionMerge = enablePartitionMerge; - EnableBurstCapacity = enableBurstCapacity; MinimalTlsVersion = minimalTlsVersion; + EnableBurstCapacity = enableBurstCapacity; CustomerManagedKeyStatus = customerManagedKeyStatus; - EnablePriorityBasedExecution = enablePriorityBasedExecution; - DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -202,7 +192,7 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l public bool? IsFreeTierEnabled { get; set; } /// API specific properties. Currently, supported only for MongoDB API. internal ApiProperties ApiProperties { get; set; } - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. [WirePath("properties.apiProperties.serverVersion")] public CosmosDBServerVersion? ApiServerVersion { @@ -249,21 +239,6 @@ public AnalyticalStorageSchemaType? AnalyticalStorageSchemaType /// An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. [WirePath("properties.networkAclBypassResourceIds")] public IList NetworkAclBypassResourceIds { get; } - /// The Object representing the different Diagnostic log settings for the Cosmos DB Account. - internal DiagnosticLogSettings DiagnosticLogSettings { get; set; } - /// Describe the level of detail with which queries are to be logged. - [WirePath("properties.diagnosticLogSettings.enableFullTextQuery")] - public EnableFullTextQuery? DiagnosticLogEnableFullTextQuery - { - get => DiagnosticLogSettings is null ? default : DiagnosticLogSettings.EnableFullTextQuery; - set - { - if (DiagnosticLogSettings is null) - DiagnosticLogSettings = new DiagnosticLogSettings(); - DiagnosticLogSettings.EnableFullTextQuery = value; - } - } - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. [WirePath("properties.disableLocalAuth")] public bool? DisableLocalAuth { get; set; } @@ -282,34 +257,22 @@ public int? CapacityTotalThroughputLimit } } - /// Indicates the capacityMode of the Cosmos DB account. - [WirePath("properties.capacityMode")] - public CapacityMode? CapacityMode { get; set; } - /// Flag to indicate whether to enable MaterializedViews on the Cosmos DB account. - [WirePath("properties.enableMaterializedViews")] - public bool? EnableMaterializedViews { get; set; } /// This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. [WirePath("properties.keysMetadata")] public DatabaseAccountKeysMetadata KeysMetadata { get; } /// Flag to indicate enabling/disabling of Partition Merge feature on the account. [WirePath("properties.enablePartitionMerge")] public bool? EnablePartitionMerge { get; set; } - /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account. - [WirePath("properties.enableBurstCapacity")] - public bool? EnableBurstCapacity { get; set; } - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. [WirePath("properties.minimalTlsVersion")] public CosmosDBMinimalTlsVersion? MinimalTlsVersion { get; set; } + /// Flag to indicate enabling/disabling of Burst Capacity feature on the account. + [WirePath("properties.enableBurstCapacity")] + public bool? EnableBurstCapacity { get; set; } /// Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. [WirePath("properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus { get; set; } - /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. - [WirePath("properties.enablePriorityBasedExecution")] - public bool? EnablePriorityBasedExecution { get; set; } - /// Enum to indicate default Priority Level of request for Priority Based Execution. - [WirePath("properties.defaultPriorityLevel")] - public DefaultPriorityLevel? DefaultPriorityLevel { get; set; } - /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs index 7385cc676e8b..0e420c9273c2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs @@ -63,11 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteEndArray(); } - if (Optional.IsDefined(SourceBackupLocation)) - { - writer.WritePropertyName("sourceBackupLocation"u8); - writer.WriteStringValue(SourceBackupLocation); - } if (Optional.IsDefined(RestoreSource)) { writer.WritePropertyName("restoreSource"u8); @@ -125,7 +120,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto IList databasesToRestore = default; IList gremlinDatabasesToRestore = default; IList tablesToRestore = default; - string sourceBackupLocation = default; string restoreSource = default; DateTimeOffset? restoreTimestampInUtc = default; bool? restoreWithTtlDisabled = default; @@ -184,11 +178,6 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto tablesToRestore = array; continue; } - if (property.NameEquals("sourceBackupLocation"u8)) - { - sourceBackupLocation = property.Value.GetString(); - continue; - } if (property.NameEquals("restoreSource"u8)) { restoreSource = property.Value.GetString(); @@ -226,8 +215,7 @@ internal static CosmosDBAccountRestoreParameters DeserializeCosmosDBAccountResto restoreMode, databasesToRestore ?? new ChangeTrackingList(), gremlinDatabasesToRestore ?? new ChangeTrackingList(), - tablesToRestore ?? new ChangeTrackingList(), - sourceBackupLocation); + tablesToRestore ?? new ChangeTrackingList()); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -338,29 +326,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceBackupLocation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceBackupLocation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceBackupLocation)) - { - builder.Append(" sourceBackupLocation: "); - if (SourceBackupLocation.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceBackupLocation}'''"); - } - else - { - builder.AppendLine($"'{SourceBackupLocation}'"); - } - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RestoreSource), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs index 11c9f08a794e..0baf944cb56e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.cs @@ -30,14 +30,12 @@ public CosmosDBAccountRestoreParameters() /// List of specific databases available for restore. /// List of specific gremlin databases available for restore. /// List of specific tables available for restore. - /// The source backup location for restore. - internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore, string sourceBackupLocation) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) + internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? restoreTimestampInUtc, bool? isRestoreWithTtlDisabled, IDictionary serializedAdditionalRawData, CosmosDBAccountRestoreMode? restoreMode, IList databasesToRestore, IList gremlinDatabasesToRestore, IList tablesToRestore) : base(restoreSource, restoreTimestampInUtc, isRestoreWithTtlDisabled, serializedAdditionalRawData) { RestoreMode = restoreMode; DatabasesToRestore = databasesToRestore; GremlinDatabasesToRestore = gremlinDatabasesToRestore; TablesToRestore = tablesToRestore; - SourceBackupLocation = sourceBackupLocation; } /// Describes the mode of the restore. @@ -52,8 +50,5 @@ internal CosmosDBAccountRestoreParameters(string restoreSource, DateTimeOffset? /// List of specific tables available for restore. [WirePath("tablesToRestore")] public IList TablesToRestore { get; } - /// The source backup location for restore. - [WirePath("sourceBackupLocation")] - public string SourceBackupLocation { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs deleted file mode 100644 index df618d0989e8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBErrorResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBErrorResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - - internal static CosmosDBErrorResult DeserializeCosmosDBErrorResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" code: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Code)) - { - builder.Append(" code: "); - if (Code.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Code}'''"); - } - else - { - builder.AppendLine($"'{Code}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" message: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Message)) - { - builder.Append(" message: "); - if (Message.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Message}'''"); - } - else - { - builder.AppendLine($"'{Message}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBErrorResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBErrorResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs deleted file mode 100644 index 39831ff05b05..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Error Response. - public partial class CosmosDBErrorResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal CosmosDBErrorResult() - { - } - - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// Keeps track of any properties unknown to the library. - internal CosmosDBErrorResult(string code, string message, IDictionary serializedAdditionalRawData) - { - Code = code; - Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Error code. - [WirePath("code")] - public string Code { get; } - /// Error message indicating why the operation failed. - [WirePath("message")] - public string Message { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs index 36694ae838ab..4aa6f13733b0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMinimalTlsVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. public readonly partial struct CosmosDBMinimalTlsVersion : IEquatable { private readonly string _value; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs index fa7d6aa40d68..123b1b5c74a6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServerVersion.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Describes the ServerVersion of an a MongoDB account. + /// Describes the version of the MongoDB account. public readonly partial struct CosmosDBServerVersion : IEquatable { private readonly string _value; @@ -28,10 +28,13 @@ public CosmosDBServerVersion(string value) private const string V4_2Value = "4.2"; private const string Five0Value = "5.0"; private const string Six0Value = "6.0"; + private const string Seven0Value = "7.0"; /// 5.0. public static CosmosDBServerVersion Five0 { get; } = new CosmosDBServerVersion(Five0Value); /// 6.0. public static CosmosDBServerVersion Six0 { get; } = new CosmosDBServerVersion(Six0Value); + /// 7.0. + public static CosmosDBServerVersion Seven0 { get; } = new CosmosDBServerVersion(Seven0Value); /// Determines if two values are the same. public static bool operator ==(CosmosDBServerVersion left, CosmosDBServerVersion right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs index 3dea4a88918d..f60fb3bdb70a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlContainerCreateOrUpdateContent DeserializeCosmosDBSql location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs index 93ebed35b8c1..bc52ada406d3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlContainerCreateOrUpdateContent(AzureLocation location, CosmosD /// The location. /// The standard JSON format of a container. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlContainerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlContainerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlContainerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs index 320d288e1805..4aec24635215 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs @@ -75,11 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -138,7 +133,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -230,15 +224,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -270,7 +255,6 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -447,21 +431,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs index cc6c3aeda029..5b923aa15943 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -67,10 +67,9 @@ public CosmosDBSqlContainerResourceInfo(string containerName) /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData) + internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -82,7 +81,6 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing AnalyticalStorageTtl = analyticalStorageTtl; RestoreParameters = restoreParameters; CreateMode = createMode; - MaterializedViewDefinition = materializedViewDefinition; ComputedProperties = computedProperties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -133,9 +131,6 @@ public IList UniqueKeys /// Enum to indicate the mode of resource creation. [WirePath("createMode")] public CosmosDBAccountCreateMode? CreateMode { get; set; } - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. - [WirePath("materializedViewDefinition")] - public MaterializedViewDefinition MaterializedViewDefinition { get; set; } /// List of computed properties. [WirePath("computedProperties")] public IList ComputedProperties { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs index cb33383f6dd1..cdbc6f80167b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlDatabaseCreateOrUpdateContent DeserializeCosmosDBSqlD location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs index 4ad9a4132deb..1c5cb4ee68d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlDatabaseCreateOrUpdateContent(AzureLocation location, CosmosDB /// The location. /// The standard JSON format of a SQL database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs index 4733d4d938ad..770e3f624ded 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlStoredProcedureCreateOrUpdateContent DeserializeCosmo location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs index 2cfc40ab5dfa..cd8b59e13e7b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlStoredProcedureCreateOrUpdateContent(AzureLocation location, C /// The location. /// The standard JSON format of a storedProcedure. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlStoredProcedureCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlStoredProcedureResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlStoredProcedureCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs index 043b0e925b5b..91c7ac55f98c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlTriggerCreateOrUpdateContent DeserializeCosmosDBSqlTr location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs index b5ec82f9849f..890b4b29a41d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlTriggerCreateOrUpdateContent(AzureLocation location, CosmosDBS /// The location. /// The standard JSON format of a trigger. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlTriggerCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlTriggerResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlTriggerCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs index 95ede0aab61a..3d081967480b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8J } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent DeserializeC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs index 9091d7a2d98e..8ff656a56c9c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(AzureLocation locatio /// The location. /// The standard JSON format of a userDefinedFunction. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBSqlUserDefinedFunctionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs index c76d86492910..df2983e849b6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs @@ -27,10 +27,6 @@ public CosmosDBStatus(string value) private const string InternallyReadyValue = "InternallyReady"; private const string OnlineValue = "Online"; private const string DeletingValue = "Deleting"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string UpdatingValue = "Updating"; /// Uninitialized. public static CosmosDBStatus Uninitialized { get; } = new CosmosDBStatus(UninitializedValue); @@ -42,14 +38,6 @@ public CosmosDBStatus(string value) public static CosmosDBStatus Online { get; } = new CosmosDBStatus(OnlineValue); /// Deleting. public static CosmosDBStatus Deleting { get; } = new CosmosDBStatus(DeletingValue); - /// Succeeded. - public static CosmosDBStatus Succeeded { get; } = new CosmosDBStatus(SucceededValue); - /// Failed. - public static CosmosDBStatus Failed { get; } = new CosmosDBStatus(FailedValue); - /// Canceled. - public static CosmosDBStatus Canceled { get; } = new CosmosDBStatus(CanceledValue); - /// Updating. - public static CosmosDBStatus Updating { get; } = new CosmosDBStatus(UpdatingValue); /// Determines if two values are the same. public static bool operator ==(CosmosDBStatus left, CosmosDBStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs index 87c96d666096..a48e4d1c76ad 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static CosmosDBTableCreateOrUpdateContent DeserializeCosmosDBTableCreat location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs index ef312eb5d395..4d9b419dd115 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public CosmosDBTableCreateOrUpdateContent(AzureLocation location, CosmosDBTableR /// The location. /// The standard JSON format of a Table. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBTableCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBTableResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal CosmosDBTableCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs deleted file mode 100644 index 5a27e018de6a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosDBThroughputPoolPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(MaxThroughput)) - { - writer.WritePropertyName("maxThroughput"u8); - writer.WriteNumberValue(MaxThroughput.Value); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosDBThroughputPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - - internal static CosmosDBThroughputPoolPatch DeserializeCosmosDBThroughputPoolPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - CosmosDBStatus? provisioningState = default; - int? maxThroughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new CosmosDBStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("maxThroughput"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - maxThroughput = property0.Value.GetInt32(); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosDBThroughputPoolPatch(provisioningState, maxThroughput, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{options.Format}' format."); - } - } - - CosmosDBThroughputPoolPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosDBThroughputPoolPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs deleted file mode 100644 index b1d54c8f96ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Represents a throughput pool resource for updates. - public partial class CosmosDBThroughputPoolPatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public CosmosDBThroughputPoolPatch() - { - } - - /// Initializes a new instance of . - /// A provisioning state of the ThroughputPool. - /// Value for throughput to be shared among CosmosDB resources in the pool. - /// Keeps track of any properties unknown to the library. - internal CosmosDBThroughputPoolPatch(CosmosDBStatus? provisioningState, int? maxThroughput, IDictionary serializedAdditionalRawData) - { - ProvisioningState = provisioningState; - MaxThroughput = maxThroughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// A provisioning state of the ThroughputPool. - [WirePath("properties.provisioningState")] - public CosmosDBStatus? ProvisioningState { get; set; } - /// Value for throughput to be shared among CosmosDB resources in the pool. - [WirePath("properties.maxThroughput")] - public int? MaxThroughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index c853f46f4ba6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosMongoDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("collectionName"u8); - writer.WriteStringValue(CollectionName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosMongoDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosMongoDataTransferDataSourceSink DeserializeCosmosMongoDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string collectionName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("collectionName"u8)) - { - collectionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosMongoDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, collectionName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" collectionName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CollectionName)) - { - builder.Append(" collectionName: "); - if (CollectionName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CollectionName}'''"); - } - else - { - builder.AppendLine($"'{CollectionName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosMongoDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosMongoDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs deleted file mode 100644 index 1f4eb9086d73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB Mongo API data source/sink. - public partial class CosmosMongoDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(collectionName, nameof(collectionName)); - - DatabaseName = databaseName; - CollectionName = collectionName; - Component = DataTransferComponent.CosmosDBMongo; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosMongoDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string collectionName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - CollectionName = collectionName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosMongoDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the collection name. - [WirePath("collectionName")] - public string CollectionName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 5d192f6f9b5b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class CosmosSqlDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("containerName"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - CosmosSqlDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - - internal static CosmosSqlDataTransferDataSourceSink DeserializeCosmosSqlDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string databaseName = default; - string containerName = default; - string remoteAccountName = default; - DataTransferComponent component = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("containerName"u8)) - { - containerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("remoteAccountName"u8)) - { - remoteAccountName = property.Value.GetString(); - continue; - } - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new CosmosSqlDataTransferDataSourceSink(component, serializedAdditionalRawData, remoteAccountName, databaseName, containerName); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" databaseName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DatabaseName)) - { - builder.Append(" databaseName: "); - if (DatabaseName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DatabaseName}'''"); - } - else - { - builder.AppendLine($"'{DatabaseName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" containerName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ContainerName)) - { - builder.Append(" containerName: "); - if (ContainerName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ContainerName}'''"); - } - else - { - builder.AppendLine($"'{ContainerName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" remoteAccountName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RemoteAccountName)) - { - builder.Append(" remoteAccountName: "); - if (RemoteAccountName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RemoteAccountName}'''"); - } - else - { - builder.AppendLine($"'{RemoteAccountName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - CosmosSqlDataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeCosmosSqlDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs deleted file mode 100644 index 44cd8c46b05c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// A CosmosDB No Sql API data source/sink. - public partial class CosmosSqlDataTransferDataSourceSink : BaseCosmosDataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// - /// or is null. - public CosmosSqlDataTransferDataSourceSink(string databaseName, string containerName) - { - Argument.AssertNotNull(databaseName, nameof(databaseName)); - Argument.AssertNotNull(containerName, nameof(containerName)); - - DatabaseName = databaseName; - ContainerName = containerName; - Component = DataTransferComponent.CosmosDBSql; - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - /// - /// - /// - internal CosmosSqlDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData, string remoteAccountName, string databaseName, string containerName) : base(component, serializedAdditionalRawData, remoteAccountName) - { - DatabaseName = databaseName; - ContainerName = containerName; - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal CosmosSqlDataTransferDataSourceSink() - { - } - - /// Gets or sets the database name. - [WirePath("databaseName")] - public string DatabaseName { get; set; } - /// Gets or sets the container name. - [WirePath("containerName")] - public string ContainerName { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs deleted file mode 100644 index 3d189bb6acd5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The DataTransferComponent. - internal readonly partial struct DataTransferComponent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferComponent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CosmosDBCassandraValue = "CosmosDBCassandra"; - private const string CosmosDBMongoValue = "CosmosDBMongo"; - private const string CosmosDBSqlValue = "CosmosDBSql"; - private const string AzureBlobStorageValue = "AzureBlobStorage"; - - /// CosmosDBCassandra. - public static DataTransferComponent CosmosDBCassandra { get; } = new DataTransferComponent(CosmosDBCassandraValue); - /// CosmosDBMongo. - public static DataTransferComponent CosmosDBMongo { get; } = new DataTransferComponent(CosmosDBMongoValue); - /// CosmosDBSql. - public static DataTransferComponent CosmosDBSql { get; } = new DataTransferComponent(CosmosDBSqlValue); - /// AzureBlobStorage. - public static DataTransferComponent AzureBlobStorage { get; } = new DataTransferComponent(AzureBlobStorageValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferComponent left, DataTransferComponent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferComponent left, DataTransferComponent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DataTransferComponent(string value) => new DataTransferComponent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferComponent other && Equals(other); - /// - public bool Equals(DataTransferComponent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index c703b56f5c56..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - [PersistableModelProxy(typeof(UnknownDataTransferDataSourceSink))] - public partial class DataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - - internal static DataTransferDataSourceSink DeserializeDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("component", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureBlobStorage": return AzureBlobDataTransferDataSourceSink.DeserializeAzureBlobDataTransferDataSourceSink(element, options); - case "BaseCosmosDataTransferDataSourceSink": return BaseCosmosDataTransferDataSourceSink.DeserializeBaseCosmosDataTransferDataSourceSink(element, options); - case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element, options); - case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element, options); - case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element, options); - } - } - return UnknownDataTransferDataSourceSink.DeserializeUnknownDataTransferDataSourceSink(element, options); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs deleted file mode 100644 index 635e008e2b82..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// - /// Base class for all DataTransfer source/sink - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - public abstract partial class DataTransferDataSourceSink - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected DataTransferDataSourceSink() - { - } - - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal DataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) - { - Component = component; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets or sets the component. - internal DataTransferComponent Component { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs deleted file mode 100644 index 2bde9271b81a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DataTransferJobFeedResults : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobFeedResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - - internal static DataTransferJobFeedResults DeserializeDataTransferJobFeedResults(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobFeedResults(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobFeedResults IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobFeedResults(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs deleted file mode 100644 index fb232389dd51..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Data Transfer jobs and their properties. - internal partial class DataTransferJobFeedResults - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal DataTransferJobFeedResults() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Data Transfer jobs and their properties. - /// URL to get the next set of Data Transfer job list results if there are any. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobFeedResults(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Data Transfer jobs and their properties. - public IReadOnlyList Value { get; } - /// URL to get the next set of Data Transfer job list results if there are any. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index e58c1dcf7a0b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static DataTransferJobGetResultCreateOrUpdateContent DeserializeDataTransferJobGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataTransferJobProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - properties = DataTransferJobProperties.DeserializeDataTransferJobProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs deleted file mode 100644 index aa6b789a0c85..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create Data Transfer Job. - public partial class DataTransferJobGetResultCreateOrUpdateContent : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Data Transfer Create Job Properties. - /// is null. - public DataTransferJobGetResultCreateOrUpdateContent(DataTransferJobProperties properties) - { - Argument.AssertNotNull(properties, nameof(properties)); - - Properties = properties; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Data Transfer Create Job Properties. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataTransferJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobGetResultCreateOrUpdateContent() - { - } - - /// Data Transfer Create Job Properties. - [WirePath("properties")] - public DataTransferJobProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs deleted file mode 100644 index 0d208c16e658..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobMode.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Mode of job execution. - public readonly partial struct DataTransferJobMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DataTransferJobMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OfflineValue = "Offline"; - private const string OnlineValue = "Online"; - - /// Offline. - public static DataTransferJobMode Offline { get; } = new DataTransferJobMode(OfflineValue); - /// Online. - public static DataTransferJobMode Online { get; } = new DataTransferJobMode(OnlineValue); - /// Determines if two values are the same. - public static bool operator ==(DataTransferJobMode left, DataTransferJobMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DataTransferJobMode left, DataTransferJobMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DataTransferJobMode(string value) => new DataTransferJobMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DataTransferJobMode other && Equals(other); - /// - public bool Equals(DataTransferJobMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs deleted file mode 100644 index c037da8e0c4a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class DataTransferJobProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(JobName)) - { - writer.WritePropertyName("jobName"u8); - writer.WriteStringValue(JobName); - } - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - writer.WritePropertyName("destination"u8); - writer.WriteObjectValue(Destination, options); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status); - } - if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) - { - writer.WritePropertyName("processedCount"u8); - writer.WriteNumberValue(ProcessedCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(TotalCount)) - { - writer.WritePropertyName("totalCount"u8); - writer.WriteNumberValue(TotalCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) - { - writer.WritePropertyName("lastUpdatedUtcTime"u8); - writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); - } - if (Optional.IsDefined(WorkerCount)) - { - writer.WritePropertyName("workerCount"u8); - writer.WriteNumberValue(WorkerCount.Value); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - if (options.Format != "W" && Optional.IsDefined(Duration)) - { - writer.WritePropertyName("duration"u8); - writer.WriteStringValue(Duration.Value, "c"); - } - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"u8); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - - internal static DataTransferJobProperties DeserializeDataTransferJobProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string jobName = default; - DataTransferDataSourceSink source = default; - DataTransferDataSourceSink destination = default; - string status = default; - long? processedCount = default; - long? totalCount = default; - DateTimeOffset? lastUpdatedUtcTime = default; - int? workerCount = default; - CosmosDBErrorResult error = default; - TimeSpan? duration = default; - DataTransferJobMode? mode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("jobName"u8)) - { - jobName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("destination"u8)) - { - destination = DataTransferDataSourceSink.DeserializeDataTransferDataSourceSink(property.Value, options); - continue; - } - if (property.NameEquals("status"u8)) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("processedCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processedCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("totalCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - totalCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("lastUpdatedUtcTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastUpdatedUtcTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("workerCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - workerCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property.Value, options); - continue; - } - if (property.NameEquals("duration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - duration = property.Value.GetTimeSpan("c"); - continue; - } - if (property.NameEquals("mode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - mode = new DataTransferJobMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DataTransferJobProperties( - jobName, - source, - destination, - status, - processedCount, - totalCount, - lastUpdatedUtcTime, - workerCount, - error, - duration, - mode, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" jobName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(JobName)) - { - builder.Append(" jobName: "); - if (JobName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{JobName}'''"); - } - else - { - builder.AppendLine($"'{JobName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" destination: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Destination)) - { - builder.Append(" destination: "); - BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" status: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Status)) - { - builder.Append(" status: "); - if (Status.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Status}'''"); - } - else - { - builder.AppendLine($"'{Status}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" processedCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProcessedCount)) - { - builder.Append(" processedCount: "); - builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" totalCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TotalCount)) - { - builder.Append(" totalCount: "); - builder.AppendLine($"'{TotalCount.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" lastUpdatedUtcTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(LastUpdatedUtcOn)) - { - builder.Append(" lastUpdatedUtcTime: "); - var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" workerCount: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(WorkerCount)) - { - builder.Append(" workerCount: "); - builder.AppendLine($"{WorkerCount.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" duration: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Duration)) - { - builder.Append(" duration: "); - var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); - builder.AppendLine($"'{formattedTimeSpan}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" mode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Mode)) - { - builder.Append(" mode: "); - builder.AppendLine($"'{Mode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{options.Format}' format."); - } - } - - DataTransferJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferJobProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs deleted file mode 100644 index cc81bf7d84c5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of a DataTransfer Job. - public partial class DataTransferJobProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// or is null. - public DataTransferJobProperties(DataTransferDataSourceSink source, DataTransferDataSourceSink destination) - { - Argument.AssertNotNull(source, nameof(source)); - Argument.AssertNotNull(destination, nameof(destination)); - - Source = source; - Destination = destination; - } - - /// Initializes a new instance of . - /// Job Name. - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - /// Job Status. - /// Processed Count. - /// Total Count. - /// Last Updated Time (ISO-8601 format). - /// Worker count. - /// Error response for Faulted job. - /// Total Duration of Job. - /// Mode of job execution. - /// Keeps track of any properties unknown to the library. - internal DataTransferJobProperties(string jobName, DataTransferDataSourceSink source, DataTransferDataSourceSink destination, string status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, DataTransferJobMode? mode, IDictionary serializedAdditionalRawData) - { - JobName = jobName; - Source = source; - Destination = destination; - Status = status; - ProcessedCount = processedCount; - TotalCount = totalCount; - LastUpdatedUtcOn = lastUpdatedUtcOn; - WorkerCount = workerCount; - Error = error; - Duration = duration; - Mode = mode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DataTransferJobProperties() - { - } - - /// Job Name. - [WirePath("jobName")] - public string JobName { get; } - /// - /// Source DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("source")] - public DataTransferDataSourceSink Source { get; set; } - /// - /// Destination DataStore details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . - /// - [WirePath("destination")] - public DataTransferDataSourceSink Destination { get; set; } - /// Job Status. - [WirePath("status")] - public string Status { get; } - /// Processed Count. - [WirePath("processedCount")] - public long? ProcessedCount { get; } - /// Total Count. - [WirePath("totalCount")] - public long? TotalCount { get; } - /// Last Updated Time (ISO-8601 format). - [WirePath("lastUpdatedUtcTime")] - public DateTimeOffset? LastUpdatedUtcOn { get; } - /// Worker count. - [WirePath("workerCount")] - public int? WorkerCount { get; set; } - /// Error response for Faulted job. - [WirePath("error")] - public CosmosDBErrorResult Error { get; } - /// Total Duration of Job. - [WirePath("duration")] - public TimeSpan? Duration { get; } - /// Mode of job execution. - [WirePath("mode")] - public DataTransferJobMode? Mode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs deleted file mode 100644 index e86d3758385b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DefaultPriorityLevel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Enum to indicate default priorityLevel of requests. - public readonly partial struct DefaultPriorityLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DefaultPriorityLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string LowValue = "Low"; - - /// High. - public static DefaultPriorityLevel High { get; } = new DefaultPriorityLevel(HighValue); - /// Low. - public static DefaultPriorityLevel Low { get; } = new DefaultPriorityLevel(LowValue); - /// Determines if two values are the same. - public static bool operator ==(DefaultPriorityLevel left, DefaultPriorityLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DefaultPriorityLevel left, DefaultPriorityLevel right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DefaultPriorityLevel(string value) => new DefaultPriorityLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DefaultPriorityLevel other && Equals(other); - /// - public bool Equals(DefaultPriorityLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs deleted file mode 100644 index 10229b3ded13..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class DiagnosticLogSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(EnableFullTextQuery)) - { - writer.WritePropertyName("enableFullTextQuery"u8); - writer.WriteStringValue(EnableFullTextQuery.Value.ToSerialString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DiagnosticLogSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - - internal static DiagnosticLogSettings DeserializeDiagnosticLogSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnableFullTextQuery? enableFullTextQuery = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enableFullTextQuery"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableFullTextQuery = property.Value.GetString().ToEnableFullTextQuery(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new DiagnosticLogSettings(enableFullTextQuery, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFullTextQuery), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EnableFullTextQuery)) - { - builder.Append(" enableFullTextQuery: "); - builder.AppendLine($"'{EnableFullTextQuery.Value.ToSerialString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{options.Format}' format."); - } - } - - DiagnosticLogSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDiagnosticLogSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs deleted file mode 100644 index b06a52a0eccd..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Indicates what diagnostic log settings are to be enabled. - internal partial class DiagnosticLogSettings - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public DiagnosticLogSettings() - { - } - - /// Initializes a new instance of . - /// Describe the level of detail with which queries are to be logged. - /// Keeps track of any properties unknown to the library. - internal DiagnosticLogSettings(EnableFullTextQuery? enableFullTextQuery, IDictionary serializedAdditionalRawData) - { - EnableFullTextQuery = enableFullTextQuery; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Describe the level of detail with which queries are to be logged. - [WirePath("enableFullTextQuery")] - public EnableFullTextQuery? EnableFullTextQuery { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs deleted file mode 100644 index f17d5acd7bf8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal static partial class EnableFullTextQueryExtensions - { - public static string ToSerialString(this EnableFullTextQuery value) => value switch - { - EnableFullTextQuery.None => "None", - EnableFullTextQuery.True => "True", - EnableFullTextQuery.False => "False", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value.") - }; - - public static EnableFullTextQuery ToEnableFullTextQuery(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return EnableFullTextQuery.None; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "True")) return EnableFullTextQuery.True; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "False")) return EnableFullTextQuery.False; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EnableFullTextQuery value."); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs deleted file mode 100644 index e851f23ff12e..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/EnableFullTextQuery.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describe the level of detail with which queries are to be logged. - public enum EnableFullTextQuery - { - /// None. - None, - /// True. - True, - /// False. - False - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs index 38c9cc44a336..669a137e7a9d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs @@ -90,11 +90,6 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -156,7 +151,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -271,15 +265,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -311,7 +296,6 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData, rid, @@ -544,21 +528,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs index 29bd68e82d12..dd115d5b5413 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -32,13 +32,12 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base(con /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, serializedAdditionalRawData) + internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs deleted file mode 100644 index b596b434dbd6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetPropertiesOptions : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - - internal static GraphResourceGetPropertiesOptions DeserializeGraphResourceGetPropertiesOptions(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? throughput = default; - AutoscaleSettings autoscaleSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("autoscaleSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoscaleSettings = AutoscaleSettings.DeserializeAutoscaleSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetPropertiesOptions(throughput, autoscaleSettings, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"{Throughput.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoscaleMaxThroughput", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" autoscaleSettings: "); - builder.AppendLine("{"); - builder.Append(" maxThroughput: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(AutoscaleSettings)) - { - builder.Append(" autoscaleSettings: "); - BicepSerializationHelpers.AppendChildObject(builder, AutoscaleSettings, options, 2, false, " autoscaleSettings: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetPropertiesOptions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetPropertiesOptions(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs deleted file mode 100644 index 666a18bb117a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The GraphResourceGetPropertiesOptions. - public partial class GraphResourceGetPropertiesOptions : CosmosDBBaseConfig - { - /// Initializes a new instance of . - public GraphResourceGetPropertiesOptions() - { - } - - /// Initializes a new instance of . - /// Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. - /// Specifies the Autoscale settings. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetPropertiesOptions(int? throughput, AutoscaleSettings autoscaleSettings, IDictionary serializedAdditionalRawData) : base(throughput, autoscaleSettings, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 672c9ad5d5cb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class GraphResourceGetResultCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - JsonSerializer.Serialize(writer, Resource); - if (Optional.IsDefined(Options)) - { - writer.WritePropertyName("options"u8); - writer.WriteObjectValue(Options, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourceGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - - internal static GraphResourceGetResultCreateOrUpdateContent DeserializeGraphResourceGetResultCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - WritableSubResource resource = default; - CosmosDBCreateUpdateConfig options0 = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = JsonSerializer.Deserialize(property0.Value.GetRawText()); - continue; - } - if (property0.NameEquals("options"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - options0 = CosmosDBCreateUpdateConfig.DeserializeCosmosDBCreateUpdateConfig(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourceGetResultCreateOrUpdateContent( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - options0, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourceId", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Options), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" options: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Options)) - { - builder.Append(" options: "); - BicepSerializationHelpers.AppendChildObject(builder, Options, options, 4, false, " options: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - GraphResourceGetResultCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourceGetResultCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs deleted file mode 100644 index b4b35b1e14d3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Parameters to create and update Cosmos DB Graph resource. - public partial class GraphResourceGetResultCreateOrUpdateContent : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a Graph resource. - /// is null. - public GraphResourceGetResultCreateOrUpdateContent(AzureLocation location, WritableSubResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a Graph resource. - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal GraphResourceGetResultCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, WritableSubResource resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Options = options; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal GraphResourceGetResultCreateOrUpdateContent() - { - } - - /// The standard JSON format of a Graph resource. - internal WritableSubResource Resource { get; set; } - /// Gets or sets Id. - [WirePath("properties.resource.id")] - public ResourceIdentifier ResourceId - { - get => Resource is null ? default : Resource.Id; - set - { - if (Resource is null) - Resource = new WritableSubResource(); - Resource.Id = value; - } - } - - /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - [WirePath("properties.options")] - public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs deleted file mode 100644 index f00a5061ab48..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class GraphResourcesListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GraphResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - - internal static GraphResourcesListResult DeserializeGraphResourcesListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GraphResourceGetResultData.DeserializeGraphResourceGetResultData(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new GraphResourcesListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{options.Format}' format."); - } - } - - GraphResourcesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGraphResourcesListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs deleted file mode 100644 index 960002eccee0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the Graph resource and their properties. - internal partial class GraphResourcesListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal GraphResourcesListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of Graph resource and their properties. - /// Keeps track of any properties unknown to the library. - internal GraphResourcesListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of Graph resource and their properties. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs index ff46c6e2103b..0bab29173f22 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static GremlinDatabaseCreateOrUpdateContent DeserializeGremlinDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs index b30d6c737abd..f3e7fbc4d1d9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinDatabaseCreateOrUpdateContent(AzureLocation location, GremlinDatab /// The location. /// The standard JSON format of a Gremlin database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs index e3680fed5987..149955c58835 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static GremlinGraphCreateOrUpdateContent DeserializeGremlinGraphCreateO location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs index 66f52d20662d..719404a9f423 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public GremlinGraphCreateOrUpdateContent(AzureLocation location, GremlinGraphRes /// The location. /// The standard JSON format of a Gremlin graph. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal GremlinGraphCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GremlinGraphResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal GremlinGraphCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs deleted file mode 100644 index 0f7e97e6ffb5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/IssueType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Type of issue. - public readonly partial struct IssueType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IssueType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnknownValue = "Unknown"; - private const string ConfigurationPropagationFailureValue = "ConfigurationPropagationFailure"; - private const string MissingPerimeterConfigurationValue = "MissingPerimeterConfiguration"; - private const string MissingIdentityConfigurationValue = "MissingIdentityConfiguration"; - - /// Unknown issue type. - public static IssueType Unknown { get; } = new IssueType(UnknownValue); - /// An error occurred while applying the network security perimeter (NSP) configuration. - public static IssueType ConfigurationPropagationFailure { get; } = new IssueType(ConfigurationPropagationFailureValue); - /// A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. - public static IssueType MissingPerimeterConfiguration { get; } = new IssueType(MissingPerimeterConfigurationValue); - /// An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. - public static IssueType MissingIdentityConfiguration { get; } = new IssueType(MissingIdentityConfigurationValue); - /// Determines if two values are the same. - public static bool operator ==(IssueType left, IssueType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IssueType left, IssueType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator IssueType(string value) => new IssueType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IssueType other && Equals(other); - /// - public bool Equals(IssueType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs deleted file mode 100644 index 242a9a8c2c49..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ListBackups : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ListBackups IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListBackups(document.RootElement, options); - } - - internal static ListBackups DeserializeListBackups(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ListBackups(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{options.Format}' format."); - } - } - - ListBackups IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeListBackups(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ListBackups)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs deleted file mode 100644 index c829eb59141a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of restorable backups for a Cassandra cluster. - internal partial class ListBackups - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ListBackups() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Container for array of backups. - /// Keeps track of any properties unknown to the library. - internal ListBackups(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Container for array of backups. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs deleted file mode 100644 index d16c6979ea3f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ListCommands : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ListCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeListCommands(document.RootElement, options); - } - - internal static ListCommands DeserializeListCommands(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CassandraClusterCommand.DeserializeCassandraClusterCommand(item, options)); - } - value = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ListCommands(value ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{options.Format}' format."); - } - } - - ListCommands IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeListCommands(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ListCommands)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs deleted file mode 100644 index d8d7eb6149b8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of commands for cluster. - internal partial class ListCommands - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ListCommands() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Container for array of commands. - /// Keeps track of any properties unknown to the library. - internal ListCommands(IReadOnlyList value, IDictionary serializedAdditionalRawData) - { - Value = value; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Container for array of commands. - [WirePath("value")] - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs deleted file mode 100644 index 4856a1ed72c1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class MaterializedViewDefinition : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(SourceCollectionRid)) - { - writer.WritePropertyName("sourceCollectionRid"u8); - writer.WriteStringValue(SourceCollectionRid); - } - writer.WritePropertyName("sourceCollectionId"u8); - writer.WriteStringValue(SourceCollectionId); - writer.WritePropertyName("definition"u8); - writer.WriteStringValue(Definition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MaterializedViewDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - - internal static MaterializedViewDefinition DeserializeMaterializedViewDefinition(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string sourceCollectionRid = default; - string sourceCollectionId = default; - string definition = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceCollectionRid"u8)) - { - sourceCollectionRid = property.Value.GetString(); - continue; - } - if (property.NameEquals("sourceCollectionId"u8)) - { - sourceCollectionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("definition"u8)) - { - definition = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionRid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionRid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionRid)) - { - builder.Append(" sourceCollectionRid: "); - if (SourceCollectionRid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionRid}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionRid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourceCollectionId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourceCollectionId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SourceCollectionId)) - { - builder.Append(" sourceCollectionId: "); - if (SourceCollectionId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{SourceCollectionId}'''"); - } - else - { - builder.AppendLine($"'{SourceCollectionId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Definition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" definition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Definition)) - { - builder.Append(" definition: "); - if (Definition.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Definition}'''"); - } - else - { - builder.AppendLine($"'{Definition}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{options.Format}' format."); - } - } - - MaterializedViewDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMaterializedViewDefinition(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs deleted file mode 100644 index b2e51f0324c1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Materialized View definition for the container. - public partial class MaterializedViewDefinition - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// or is null. - public MaterializedViewDefinition(string sourceCollectionId, string definition) - { - Argument.AssertNotNull(sourceCollectionId, nameof(sourceCollectionId)); - Argument.AssertNotNull(definition, nameof(definition)); - - SourceCollectionId = sourceCollectionId; - Definition = definition; - } - - /// Initializes a new instance of . - /// An unique identifier for the source collection. This is a system generated property. - /// The name of the source container on which the Materialized View will be created. - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - /// Keeps track of any properties unknown to the library. - internal MaterializedViewDefinition(string sourceCollectionRid, string sourceCollectionId, string definition, IDictionary serializedAdditionalRawData) - { - SourceCollectionRid = sourceCollectionRid; - SourceCollectionId = sourceCollectionId; - Definition = definition; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MaterializedViewDefinition() - { - } - - /// An unique identifier for the source collection. This is a system generated property. - [WirePath("sourceCollectionRid")] - public string SourceCollectionRid { get; } - /// The name of the source container on which the Materialized View will be created. - [WirePath("sourceCollectionId")] - public string SourceCollectionId { get; set; } - /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. - [WirePath("definition")] - public string Definition { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs deleted file mode 100644 index 1fcc123a5530..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class MergeParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(IsDryRun)) - { - writer.WritePropertyName("isDryRun"u8); - writer.WriteBooleanValue(IsDryRun.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - MergeParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMergeParameters(document.RootElement, options); - } - - internal static MergeParameters DeserializeMergeParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - bool? isDryRun = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isDryRun"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - isDryRun = property.Value.GetBoolean(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MergeParameters(isDryRun, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{options.Format}' format."); - } - } - - MergeParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMergeParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MergeParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs deleted file mode 100644 index 86efed3e5857..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of an Azure Cosmos DB merge operations. - public partial class MergeParameters - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public MergeParameters() - { - } - - /// Initializes a new instance of . - /// Specifies whether the operation is a real merge operation or a simulation. - /// Keeps track of any properties unknown to the library. - internal MergeParameters(bool? isDryRun, IDictionary serializedAdditionalRawData) - { - IsDryRun = isDryRun; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies whether the operation is a real merge operation or a simulation. - [WirePath("isDryRun")] - public bool? IsDryRun { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs index 66a97aabb73c..d3da47a1acb2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static MongoDBCollectionCreateOrUpdateContent DeserializeMongoDBCollect location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs index aa5160f84cca..6fbc0d6a18e1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBCollectionCreateOrUpdateContent(AzureLocation location, MongoDBCol /// The location. /// The standard JSON format of a MongoDB collection. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBCollectionResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBCollectionCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs index d7cb06e66414..07ec40e4d580 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,7 +110,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -129,16 +122,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -223,7 +206,6 @@ internal static MongoDBDatabaseCreateOrUpdateContent DeserializeMongoDBDatabaseC location, resource, options0, - identity, serializedAdditionalRawData); } @@ -310,21 +292,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs index 2b571cead553..3e49d095be97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.cs @@ -67,13 +67,11 @@ public MongoDBDatabaseCreateOrUpdateContent(AzureLocation location, MongoDBDatab /// The location. /// The standard JSON format of a MongoDB database. /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MongoDBDatabaseResourceInfo resource, CosmosDBCreateUpdateConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,8 +86,5 @@ internal MongoDBDatabaseCreateOrUpdateContent() /// A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. [WirePath("properties.options")] public CosmosDBCreateUpdateConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs deleted file mode 100644 index 0f1a348e6a32..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(PerimeterGuid)) - { - writer.WritePropertyName("perimeterGuid"u8); - writer.WriteStringValue(PerimeterGuid.Value); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - - internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - Guid? perimeterGuid = default; - AzureLocation? location = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("perimeterGuid"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - perimeterGuid = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PerimeterGuid)) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine($"'{PerimeterGuid.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Location)) - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeter(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs deleted file mode 100644 index 9a38aee3d8f6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Information about a network security perimeter (NSP). - public partial class NetworkSecurityPerimeter - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeter() - { - } - - /// Initializes a new instance of . - /// Fully qualified Azure resource ID of the NSP resource. - /// Universal unique ID (UUID) of the network security perimeter. - /// Location of the network security perimeter. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeter(ResourceIdentifier id, Guid? perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) - { - Id = id; - PerimeterGuid = perimeterGuid; - Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Fully qualified Azure resource ID of the NSP resource. - [WirePath("id")] - public ResourceIdentifier Id { get; set; } - /// Universal unique ID (UUID) of the network security perimeter. - [WirePath("perimeterGuid")] - public Guid? PerimeterGuid { get; set; } - /// Location of the network security perimeter. - [WirePath("location")] - public AzureLocation? Location { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs deleted file mode 100644 index 941563248e65..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class NetworkSecurityPerimeterConfigurationListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink.AbsoluteUri); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetworkSecurityPerimeterConfigurationListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - nextLink = new Uri(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - builder.AppendLine($"'{NextLink.AbsoluteUri}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs deleted file mode 100644 index fda9bc0d243f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Result of a list NSP (network security perimeter) configurations request. - internal partial class NetworkSecurityPerimeterConfigurationListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal NetworkSecurityPerimeterConfigurationListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of network security perimeter results. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of network security perimeter results. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public Uri NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs deleted file mode 100644 index 52e5510825bb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsCollectionDefined(ProvisioningIssues)) - { - writer.WritePropertyName("provisioningIssues"u8); - writer.WriteStartArray(); - foreach (var item in ProvisioningIssues) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - writer.WritePropertyName("networkSecurityPerimeter"u8); - writer.WriteObjectValue(NetworkSecurityPerimeter, options); - } - if (Optional.IsDefined(ResourceAssociation)) - { - writer.WritePropertyName("resourceAssociation"u8); - writer.WriteObjectValue(ResourceAssociation, options); - } - if (Optional.IsDefined(Profile)) - { - writer.WritePropertyName("profile"u8); - writer.WriteObjectValue(Profile, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationProperties DeserializeNetworkSecurityPerimeterConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default; - IReadOnlyList provisioningIssues = default; - NetworkSecurityPerimeter networkSecurityPerimeter = default; - ResourceAssociation resourceAssociation = default; - NetworkSecurityProfile profile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("provisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new NetworkSecurityPerimeterConfigurationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("provisioningIssues"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item, options)); - } - provisioningIssues = array; - continue; - } - if (property.NameEquals("networkSecurityPerimeter"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property.Value, options); - continue; - } - if (property.NameEquals("resourceAssociation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceAssociation = ResourceAssociation.DeserializeResourceAssociation(property.Value, options); - continue; - } - if (property.NameEquals("profile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - profile = NetworkSecurityProfile.DeserializeNetworkSecurityProfile(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationProperties( - provisioningState, - provisioningIssues ?? new ChangeTrackingList(), - networkSecurityPerimeter, - resourceAssociation, - profile, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ProvisioningIssues)) - { - if (ProvisioningIssues.Any()) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine("["); - foreach (var item in ProvisioningIssues) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " provisioningIssues: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeter: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - builder.Append(" networkSecurityPerimeter: "); - BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 2, false, " networkSecurityPerimeter: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resourceAssociation: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ResourceAssociation)) - { - builder.Append(" resourceAssociation: "); - BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 2, false, " resourceAssociation: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" profile: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Profile)) - { - builder.Append(" profile: "); - BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 2, false, " profile: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs deleted file mode 100644 index 0ed13065c6b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security configuration properties. - public partial class NetworkSecurityPerimeterConfigurationProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationProperties() - { - ProvisioningIssues = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Provisioning state of a network security perimeter configuration that is being created or updated. - /// List of provisioning issues, if any. - /// Information about a network security perimeter (NSP). - /// Information about resource association. - /// Network security perimeter configuration profile. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState, IReadOnlyList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, NetworkSecurityProfile profile, IDictionary serializedAdditionalRawData) - { - ProvisioningState = provisioningState; - ProvisioningIssues = provisioningIssues; - NetworkSecurityPerimeter = networkSecurityPerimeter; - ResourceAssociation = resourceAssociation; - Profile = profile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Provisioning state of a network security perimeter configuration that is being created or updated. - [WirePath("provisioningState")] - public NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } - /// List of provisioning issues, if any. - [WirePath("provisioningIssues")] - public IReadOnlyList ProvisioningIssues { get; } - /// Information about a network security perimeter (NSP). - [WirePath("networkSecurityPerimeter")] - public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } - /// Information about resource association. - [WirePath("resourceAssociation")] - public ResourceAssociation ResourceAssociation { get; set; } - /// Network security perimeter configuration profile. - [WirePath("profile")] - public NetworkSecurityProfile Profile { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs deleted file mode 100644 index f5ce9755e824..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Provisioning state of a network security perimeter configuration that is being created or updated. - public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NetworkSecurityPerimeterConfigurationProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string CreatingValue = "Creating"; - private const string UpdatingValue = "Updating"; - private const string DeletingValue = "Deleting"; - private const string AcceptedValue = "Accepted"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - - /// Succeeded. - public static NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededValue); - /// Creating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Creating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CreatingValue); - /// Updating. - public static NetworkSecurityPerimeterConfigurationProvisioningState Updating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UpdatingValue); - /// Deleting. - public static NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletingValue); - /// Accepted. - public static NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(AcceptedValue); - /// Failed. - public static NetworkSecurityPerimeterConfigurationProvisioningState Failed { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(FailedValue); - /// Canceled. - public static NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) => new NetworkSecurityPerimeterConfigurationProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is NetworkSecurityPerimeterConfigurationProvisioningState other && Equals(other); - /// - public bool Equals(NetworkSecurityPerimeterConfigurationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs deleted file mode 100644 index 154b9b9f4e36..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class NetworkSecurityProfile : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessRulesVersion)) - { - writer.WritePropertyName("accessRulesVersion"u8); - writer.WriteNumberValue(AccessRulesVersion.Value); - } - if (Optional.IsCollectionDefined(AccessRules)) - { - writer.WritePropertyName("accessRules"u8); - writer.WriteStartArray(); - foreach (var item in AccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - writer.WritePropertyName("diagnosticSettingsVersion"u8); - writer.WriteNumberValue(DiagnosticSettingsVersion.Value); - } - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - writer.WritePropertyName("enabledLogCategories"u8); - writer.WriteStartArray(); - foreach (var item in EnabledLogCategories) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - - internal static NetworkSecurityProfile DeserializeNetworkSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - int? accessRulesVersion = default; - IList accessRules = default; - int? diagnosticSettingsVersion = default; - IList enabledLogCategories = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessRulesVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessRulesVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("accessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - accessRules = array; - continue; - } - if (property.NameEquals("diagnosticSettingsVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - diagnosticSettingsVersion = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("enabledLogCategories"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - enabledLogCategories = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityProfile( - name, - accessRulesVersion, - accessRules ?? new ChangeTrackingList(), - diagnosticSettingsVersion, - enabledLogCategories ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRulesVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessRulesVersion)) - { - builder.Append(" accessRulesVersion: "); - builder.AppendLine($"{AccessRulesVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AccessRules)) - { - if (AccessRules.Any()) - { - builder.Append(" accessRules: "); - builder.AppendLine("["); - foreach (var item in AccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " accessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiagnosticSettingsVersion), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DiagnosticSettingsVersion)) - { - builder.Append(" diagnosticSettingsVersion: "); - builder.AppendLine($"{DiagnosticSettingsVersion.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnabledLogCategories), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(EnabledLogCategories)) - { - if (EnabledLogCategories.Any()) - { - builder.Append(" enabledLogCategories: "); - builder.AppendLine("["); - foreach (var item in EnabledLogCategories) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityProfile(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs deleted file mode 100644 index 7bef32097d83..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Network security perimeter configuration profile. - public partial class NetworkSecurityProfile - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityProfile() - { - AccessRules = new ChangeTrackingList(); - EnabledLogCategories = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Name of the profile. - /// Current access rules version. - /// List of Access Rules. - /// Current diagnostic settings version. - /// List of log categories that are enabled. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityProfile(string name, int? accessRulesVersion, IList accessRules, int? diagnosticSettingsVersion, IList enabledLogCategories, IDictionary serializedAdditionalRawData) - { - Name = name; - AccessRulesVersion = accessRulesVersion; - AccessRules = accessRules; - DiagnosticSettingsVersion = diagnosticSettingsVersion; - EnabledLogCategories = enabledLogCategories; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the profile. - [WirePath("name")] - public string Name { get; set; } - /// Current access rules version. - [WirePath("accessRulesVersion")] - public int? AccessRulesVersion { get; set; } - /// List of Access Rules. - [WirePath("accessRules")] - public IList AccessRules { get; } - /// Current diagnostic settings version. - [WirePath("diagnosticSettingsVersion")] - public int? DiagnosticSettingsVersion { get; set; } - /// List of log categories that are enabled. - [WirePath("enabledLogCategories")] - public IList EnabledLogCategories { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs deleted file mode 100644 index a572464131fc..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfo : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W" && Optional.IsDefined(StorageInKB)) - { - writer.WritePropertyName("storageInKB"u8); - writer.WriteNumberValue(StorageInKB.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionStorageInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfo DeserializePhysicalPartitionStorageInfo(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? storageInKB = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("storageInKB"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageInKB = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfo(id, storageInKB, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageInKB), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" storageInKB: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(StorageInKB)) - { - builder.Append(" storageInKB: "); - builder.AppendLine($"'{StorageInKB.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionStorageInfo(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs deleted file mode 100644 index a2d430ffe7a2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The storage of a physical partition. - public partial class PhysicalPartitionStorageInfo - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfo() - { - } - - /// Initializes a new instance of . - /// The unique identifier of the partition. - /// The storage in KB for the physical partition. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfo(string id, double? storageInKB, IDictionary serializedAdditionalRawData) - { - Id = id; - StorageInKB = storageInKB; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The unique identifier of the partition. - [WirePath("id")] - public string Id { get; } - /// The storage in KB for the physical partition. - [WirePath("storageInKB")] - public double? StorageInKB { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs deleted file mode 100644 index ed2bb4b36431..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionStorageInfoCollection : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - writer.WritePropertyName("physicalPartitionStorageInfoCollection"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionStorageInfoCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - - internal static PhysicalPartitionStorageInfoCollection DeserializePhysicalPartitionStorageInfoCollection(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList physicalPartitionStorageInfoCollection = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionStorageInfoCollection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionStorageInfo.DeserializePhysicalPartitionStorageInfo(item, options)); - } - physicalPartitionStorageInfoCollection = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionStorageInfoCollection(physicalPartitionStorageInfoCollection ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionStorageInfoCollectionValue), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) - { - if (PhysicalPartitionStorageInfoCollectionValue.Any()) - { - builder.Append(" physicalPartitionStorageInfoCollection: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionStorageInfoCollectionValue) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionStorageInfoCollection: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionStorageInfoCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionStorageInfoCollection(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs deleted file mode 100644 index 0daaa283f1aa..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// List of physical partitions and their properties returned by a merge operation. - public partial class PhysicalPartitionStorageInfoCollection - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal PhysicalPartitionStorageInfoCollection() - { - PhysicalPartitionStorageInfoCollectionValue = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of physical partitions and their properties. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionStorageInfoCollection(IReadOnlyList physicalPartitionStorageInfoCollectionValue, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionStorageInfoCollectionValue = physicalPartitionStorageInfoCollectionValue; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of physical partitions and their properties. - [WirePath("physicalPartitionStorageInfoCollection")] - public IReadOnlyList PhysicalPartitionStorageInfoCollectionValue { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs deleted file mode 100644 index 6bc181c170b0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoProperties DeserializePhysicalPartitionThroughputInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoProperties(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs deleted file mode 100644 index 97162b467507..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. - internal partial class PhysicalPartitionThroughputInfoProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoProperties() - { - PhysicalPartitionThroughputInfo = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoProperties(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionThroughputInfo = physicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Array of physical partition throughput info objects. - [WirePath("physicalPartitionThroughputInfo")] - public IList PhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs deleted file mode 100644 index f3f7e055ab13..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResource DeserializePhysicalPartitionThroughputInfoResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - double? throughput = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("throughput"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - throughput = property.Value.GetDouble(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResource(id, throughput, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Throughput), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughput: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Throughput)) - { - builder.Append(" throughput: "); - builder.AppendLine($"'{Throughput.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs deleted file mode 100644 index 966c4d6682bb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// PhysicalPartitionThroughputInfo object. - public partial class PhysicalPartitionThroughputInfoResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Id of a physical partition. - /// is null. - public PhysicalPartitionThroughputInfoResource(string id) - { - Argument.AssertNotNull(id, nameof(id)); - - Id = id; - } - - /// Initializes a new instance of . - /// Id of a physical partition. - /// Throughput of a physical partition. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, IDictionary serializedAdditionalRawData) - { - Id = id; - Throughput = throughput; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResource() - { - } - - /// Id of a physical partition. - [WirePath("id")] - public string Id { get; set; } - /// Throughput of a physical partition. - [WirePath("throughput")] - public double? Throughput { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs deleted file mode 100644 index fb2383870ae5..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class PhysicalPartitionThroughputInfoResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Resource)) - { - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResult DeserializePhysicalPartitionThroughputInfoResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - PhysicalPartitionThroughputInfoResultPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resource = PhysicalPartitionThroughputInfoResultPropertiesResource.DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResult( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionThroughputInfo", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs deleted file mode 100644 index 8bba9011413b..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. - public partial class PhysicalPartitionThroughputInfoResult : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public PhysicalPartitionThroughputInfoResult(AzureLocation location) : base(location) - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// properties of physical partition throughput info. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PhysicalPartitionThroughputInfoResultPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal PhysicalPartitionThroughputInfoResult() - { - } - - /// properties of physical partition throughput info. - internal PhysicalPartitionThroughputInfoResultPropertiesResource Resource { get; set; } - /// Array of physical partition throughput info objects. - [WirePath("properties.resource.physicalPartitionThroughputInfo")] - public IList ResourcePhysicalPartitionThroughputInfo - { - get - { - if (Resource is null) - Resource = new PhysicalPartitionThroughputInfoResultPropertiesResource(); - return Resource.PhysicalPartitionThroughputInfo; - } - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs deleted file mode 100644 index 1cdc443d18f8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - - internal static PhysicalPartitionThroughputInfoResultPropertiesResource DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionThroughputInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - physicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResultPropertiesResource(physicalPartitionThroughputInfo ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - if (PhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" physicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - PhysicalPartitionThroughputInfoResultPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializePhysicalPartitionThroughputInfoResultPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs deleted file mode 100644 index ffa08db0780d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// properties of physical partition throughput info. - internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : PhysicalPartitionThroughputInfoProperties - { - /// Initializes a new instance of . - public PhysicalPartitionThroughputInfoResultPropertiesResource() - { - } - - /// Initializes a new instance of . - /// Array of physical partition throughput info objects. - /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResultPropertiesResource(IList physicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) : base(physicalPartitionThroughputInfo, serializedAdditionalRawData) - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs deleted file mode 100644 index 3ad4d9f142b2..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssue : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssue(document.RootElement, options); - } - - internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ProvisioningIssueProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssue(name, properties, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProvisioningIssue(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs deleted file mode 100644 index 4f32a2bb5d5f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Describes a provisioning issue for a network security perimeter configuration. - public partial class ProvisioningIssue - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssue() - { - } - - /// Initializes a new instance of . - /// Name of the issue. - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssue(string name, ProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) - { - Name = name; - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the issue. - [WirePath("name")] - public string Name { get; } - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - [WirePath("properties")] - public ProvisioningIssueProperties Properties { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs deleted file mode 100644 index 5cfce516a6f9..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ProvisioningIssueProperties : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(IssueType)) - { - writer.WritePropertyName("issueType"u8); - writer.WriteStringValue(IssueType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedResourceIds)) - { - writer.WritePropertyName("suggestedResourceIds"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedAccessRules)) - { - writer.WritePropertyName("suggestedAccessRules"u8); - writer.WriteStartArray(); - foreach (var item in SuggestedAccessRules) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - - internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IssueType? issueType = default; - Severity? severity = default; - string description = default; - IReadOnlyList suggestedResourceIds = default; - IReadOnlyList suggestedAccessRules = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - issueType = new IssueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("severity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - severity = new Severity(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("suggestedResourceIds"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } - } - suggestedResourceIds = array; - continue; - } - if (property.NameEquals("suggestedAccessRules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AccessRule.DeserializeAccessRule(item, options)); - } - suggestedAccessRules = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ProvisioningIssueProperties( - issueType, - severity, - description, - suggestedResourceIds ?? new ChangeTrackingList(), - suggestedAccessRules ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IssueType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" issueType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(IssueType)) - { - builder.Append(" issueType: "); - builder.AppendLine($"'{IssueType.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Severity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" severity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Severity)) - { - builder.Append(" severity: "); - builder.AppendLine($"'{Severity.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" description: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Description)) - { - builder.Append(" description: "); - if (Description.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Description}'''"); - } - else - { - builder.AppendLine($"'{Description}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedResourceIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedResourceIds)) - { - if (SuggestedResourceIds.Any()) - { - builder.Append(" suggestedResourceIds: "); - builder.AppendLine("["); - foreach (var item in SuggestedResourceIds) - { - if (item == null) - { - builder.Append("null"); - continue; - } - builder.AppendLine($" '{item.ToString()}'"); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedAccessRules), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SuggestedAccessRules)) - { - if (SuggestedAccessRules.Any()) - { - builder.Append(" suggestedAccessRules: "); - builder.AppendLine("["); - foreach (var item in SuggestedAccessRules) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " suggestedAccessRules: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{options.Format}' format."); - } - } - - ProvisioningIssueProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProvisioningIssueProperties(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs deleted file mode 100644 index bcbdbd08f583..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. - public partial class ProvisioningIssueProperties - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ProvisioningIssueProperties() - { - SuggestedResourceIds = new ChangeTrackingList(); - SuggestedAccessRules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Type of issue. - /// Severity of the issue. - /// Description of the issue. - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - /// Keeps track of any properties unknown to the library. - internal ProvisioningIssueProperties(IssueType? issueType, Severity? severity, string description, IReadOnlyList suggestedResourceIds, IReadOnlyList suggestedAccessRules, IDictionary serializedAdditionalRawData) - { - IssueType = issueType; - Severity = severity; - Description = description; - SuggestedResourceIds = suggestedResourceIds; - SuggestedAccessRules = suggestedAccessRules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Type of issue. - [WirePath("issueType")] - public IssueType? IssueType { get; } - /// Severity of the issue. - [WirePath("severity")] - public Severity? Severity { get; } - /// Description of the issue. - [WirePath("description")] - public string Description { get; } - /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - [WirePath("suggestedResourceIds")] - public IReadOnlyList SuggestedResourceIds { get; } - /// Access rules that can be added to the network security profile (NSP) to remediate the issue. - [WirePath("suggestedAccessRules")] - public IReadOnlyList SuggestedAccessRules { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs deleted file mode 100644 index 1163bc237047..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RedistributeThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - - internal static RedistributeThroughputParameters DeserializeRedistributeThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RedistributeThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RedistributeThroughputPropertiesResource.DeserializeRedistributeThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resource), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedistributeThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs deleted file mode 100644 index 57defd98b0ce..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB redistribute throughput parameters object. - public partial class RedistributeThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RedistributeThroughputParameters(AzureLocation location, RedistributeThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RedistributeThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - [WirePath("properties.resource")] - public RedistributeThroughputPropertiesResource Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index 7ef27772ab3f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RedistributeThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("throughputPolicy"u8); - writer.WriteStringValue(ThroughputPolicy.ToString()); - writer.WritePropertyName("targetPhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - writer.WritePropertyName("sourcePhysicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RedistributeThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - - internal static RedistributeThroughputPropertiesResource DeserializeRedistributeThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ThroughputPolicyType throughputPolicy = default; - IList targetPhysicalPartitionThroughputInfo = default; - IList sourcePhysicalPartitionThroughputInfo = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("throughputPolicy"u8)) - { - throughputPolicy = new ThroughputPolicyType(property.Value.GetString()); - continue; - } - if (property.NameEquals("targetPhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - targetPhysicalPartitionThroughputInfo = array; - continue; - } - if (property.NameEquals("sourcePhysicalPartitionThroughputInfo"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(PhysicalPartitionThroughputInfoResource.DeserializePhysicalPartitionThroughputInfoResource(item, options)); - } - sourcePhysicalPartitionThroughputInfo = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RedistributeThroughputPropertiesResource(throughputPolicy, targetPhysicalPartitionThroughputInfo, sourcePhysicalPartitionThroughputInfo, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputPolicy), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" throughputPolicy: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" throughputPolicy: "); - builder.AppendLine($"'{ThroughputPolicy.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetPhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(TargetPhysicalPartitionThroughputInfo)) - { - if (TargetPhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" targetPhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in TargetPhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " targetPhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SourcePhysicalPartitionThroughputInfo), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(SourcePhysicalPartitionThroughputInfo)) - { - if (SourcePhysicalPartitionThroughputInfo.Any()) - { - builder.Append(" sourcePhysicalPartitionThroughputInfo: "); - builder.AppendLine("["); - foreach (var item in SourcePhysicalPartitionThroughputInfo) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " sourcePhysicalPartitionThroughputInfo: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RedistributeThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRedistributeThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs deleted file mode 100644 index 976ba582e211..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Resource to redistribute throughput for Azure Cosmos DB resource. - public partial class RedistributeThroughputPropertiesResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// or is null. - public RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IEnumerable targetPhysicalPartitionThroughputInfo, IEnumerable sourcePhysicalPartitionThroughputInfo) - { - Argument.AssertNotNull(targetPhysicalPartitionThroughputInfo, nameof(targetPhysicalPartitionThroughputInfo)); - Argument.AssertNotNull(sourcePhysicalPartitionThroughputInfo, nameof(sourcePhysicalPartitionThroughputInfo)); - - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo.ToList(); - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo.ToList(); - } - - /// Initializes a new instance of . - /// ThroughputPolicy to apply for throughput redistribution. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Array of PhysicalPartitionThroughputInfoResource objects. - /// Keeps track of any properties unknown to the library. - internal RedistributeThroughputPropertiesResource(ThroughputPolicyType throughputPolicy, IList targetPhysicalPartitionThroughputInfo, IList sourcePhysicalPartitionThroughputInfo, IDictionary serializedAdditionalRawData) - { - ThroughputPolicy = throughputPolicy; - TargetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo; - SourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RedistributeThroughputPropertiesResource() - { - } - - /// ThroughputPolicy to apply for throughput redistribution. - [WirePath("throughputPolicy")] - public ThroughputPolicyType ThroughputPolicy { get; set; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("targetPhysicalPartitionThroughputInfo")] - public IList TargetPhysicalPartitionThroughputInfo { get; } - /// Array of PhysicalPartitionThroughputInfoResource objects. - [WirePath("sourcePhysicalPartitionThroughputInfo")] - public IList SourcePhysicalPartitionThroughputInfo { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs deleted file mode 100644 index a61d7bd79944..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class ResourceAssociation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(AccessMode)) - { - writer.WritePropertyName("accessMode"u8); - writer.WriteStringValue(AccessMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ResourceAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeResourceAssociation(document.RootElement, options); - } - - internal static ResourceAssociation DeserializeResourceAssociation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - ResourceAssociationAccessMode? accessMode = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("accessMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - accessMode = new ResourceAssociationAccessMode(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ResourceAssociation(name, accessMode, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessMode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" accessMode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AccessMode)) - { - builder.Append(" accessMode: "); - builder.AppendLine($"'{AccessMode.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{options.Format}' format."); - } - } - - ResourceAssociation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeResourceAssociation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs deleted file mode 100644 index f4875e8731e8..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Information about resource association. - public partial class ResourceAssociation - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ResourceAssociation() - { - } - - /// Initializes a new instance of . - /// Name of the resource association. - /// Access mode of the resource association. - /// Keeps track of any properties unknown to the library. - internal ResourceAssociation(string name, ResourceAssociationAccessMode? accessMode, IDictionary serializedAdditionalRawData) - { - Name = name; - AccessMode = accessMode; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Name of the resource association. - [WirePath("name")] - public string Name { get; set; } - /// Access mode of the resource association. - [WirePath("accessMode")] - public ResourceAssociationAccessMode? AccessMode { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs deleted file mode 100644 index 97198e642f4c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociationAccessMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Access mode of the resource association. - public readonly partial struct ResourceAssociationAccessMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ResourceAssociationAccessMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnforcedValue = "Enforced"; - private const string LearningValue = "Learning"; - private const string AuditValue = "Audit"; - - /// Enforced access mode - traffic to the resource that failed access checks is blocked. - public static ResourceAssociationAccessMode Enforced { get; } = new ResourceAssociationAccessMode(EnforcedValue); - /// Learning access mode - traffic to the resource is enabled for analysis but not blocked. - public static ResourceAssociationAccessMode Learning { get; } = new ResourceAssociationAccessMode(LearningValue); - /// Audit access mode - traffic to the resource that fails access checks is logged but not blocked. - public static ResourceAssociationAccessMode Audit { get; } = new ResourceAssociationAccessMode(AuditValue); - /// Determines if two values are the same. - public static bool operator ==(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ResourceAssociationAccessMode(string value) => new ResourceAssociationAccessMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ResourceAssociationAccessMode other && Equals(other); - /// - public bool Equals(ResourceAssociationAccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs index ae926e9fc922..2b68debde754 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -95,11 +95,6 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -162,7 +157,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes long? analyticalStorageTtl = default; ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; - MaterializedViewDefinition materializedViewDefinition = default; IList computedProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -282,15 +276,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } - if (property.NameEquals("materializedViewDefinition"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); - continue; - } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -322,7 +307,6 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes analyticalStorageTtl, restoreParameters, createMode, - materializedViewDefinition, computedProperties ?? new ChangeTrackingList(), serializedAdditionalRawData, self, @@ -579,21 +563,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViewDefinition), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" materializedViewDefinition: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(MaterializedViewDefinition)) - { - builder.Append(" materializedViewDefinition: "); - BicepSerializationHelpers.AppendChildObject(builder, MaterializedViewDefinition, options, 2, false, " materializedViewDefinition: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index 4c8b5028942d..7d4e4fbcc13a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -32,14 +32,13 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// List of computed properties. /// Keeps track of any properties unknown to the library. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, serializedAdditionalRawData) + internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, IList computedProperties, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, serializedAdditionalRawData) { Self = self; Rid = rid; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs deleted file mode 100644 index 2adaa73f9dd4..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputParameters : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("resource"u8); - writer.WriteObjectValue(Resource, options); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RetrieveThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - - internal static RetrieveThroughputParameters DeserializeRetrieveThroughputParameters(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - RetrieveThroughputPropertiesResource resource = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resource"u8)) - { - resource = RetrieveThroughputPropertiesResource.DeserializeRetrieveThroughputPropertiesResource(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputParameters( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - resource, - identity, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResourcePhysicalPartitionIds", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" resource: "); - builder.AppendLine("{"); - builder.AppendLine(" resource: {"); - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Resource)) - { - builder.Append(" resource: "); - BicepSerializationHelpers.AppendChildObject(builder, Resource, options, 4, false, " resource: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRetrieveThroughputParameters(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs deleted file mode 100644 index f9a7b72442b1..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Cosmos DB retrieve throughput parameters object. - public partial class RetrieveThroughputParameters : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - /// The standard JSON format of a resource throughput. - /// is null. - public RetrieveThroughputParameters(AzureLocation location, RetrieveThroughputPropertiesResource resource) : base(location) - { - Argument.AssertNotNull(resource, nameof(resource)); - - Resource = resource; - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The standard JSON format of a resource throughput. - /// Identity for the resource. - /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputParameters(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, RetrieveThroughputPropertiesResource resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Resource = resource; - Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputParameters() - { - } - - /// The standard JSON format of a resource throughput. - internal RetrieveThroughputPropertiesResource Resource { get; set; } - /// Array of PhysicalPartitionId objects. - [WirePath("properties.resource.physicalPartitionIds")] - public IList ResourcePhysicalPartitionIds - { - get => Resource is null ? default : Resource.PhysicalPartitionIds; - set => Resource = new RetrieveThroughputPropertiesResource(value); - } - - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs deleted file mode 100644 index ad10bd2bd2cb..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - public partial class RetrieveThroughputPropertiesResource : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("physicalPartitionIds"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionIds) - { - JsonSerializer.Serialize(writer, item); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - RetrieveThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - - internal static RetrieveThroughputPropertiesResource DeserializeRetrieveThroughputPropertiesResource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList physicalPartitionIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("physicalPartitionIds"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - physicalPartitionIds = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RetrieveThroughputPropertiesResource(physicalPartitionIds, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhysicalPartitionIds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(PhysicalPartitionIds)) - { - if (PhysicalPartitionIds.Any()) - { - builder.Append(" physicalPartitionIds: "); - builder.AppendLine("["); - foreach (var item in PhysicalPartitionIds) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " physicalPartitionIds: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{options.Format}' format."); - } - } - - RetrieveThroughputPropertiesResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRetrieveThroughputPropertiesResource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs deleted file mode 100644 index c964fa9ca2b6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Resource to retrieve throughput information for Cosmos DB resource. - public partial class RetrieveThroughputPropertiesResource - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. - /// is null. - public RetrieveThroughputPropertiesResource(IEnumerable physicalPartitionIds) - { - Argument.AssertNotNull(physicalPartitionIds, nameof(physicalPartitionIds)); - - PhysicalPartitionIds = physicalPartitionIds.ToList(); - } - - /// Initializes a new instance of . - /// Array of PhysicalPartitionId objects. - /// Keeps track of any properties unknown to the library. - internal RetrieveThroughputPropertiesResource(IList physicalPartitionIds, IDictionary serializedAdditionalRawData) - { - PhysicalPartitionIds = physicalPartitionIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RetrieveThroughputPropertiesResource() - { - } - - /// Array of PhysicalPartitionId objects. - [WirePath("physicalPartitionIds")] - public IList PhysicalPartitionIds { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs deleted file mode 100644 index e25796df7093..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ScheduledEventStrategy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// How the nodes in the cluster react to scheduled events. - public readonly partial struct ScheduledEventStrategy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScheduledEventStrategy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IgnoreValue = "Ignore"; - private const string StopAnyValue = "StopAny"; - private const string StopByRackValue = "StopByRack"; - - /// Ignore. - public static ScheduledEventStrategy Ignore { get; } = new ScheduledEventStrategy(IgnoreValue); - /// StopAny. - public static ScheduledEventStrategy StopAny { get; } = new ScheduledEventStrategy(StopAnyValue); - /// StopByRack. - public static ScheduledEventStrategy StopByRack { get; } = new ScheduledEventStrategy(StopByRackValue); - /// Determines if two values are the same. - public static bool operator ==(ScheduledEventStrategy left, ScheduledEventStrategy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScheduledEventStrategy left, ScheduledEventStrategy right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ScheduledEventStrategy(string value) => new ScheduledEventStrategy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScheduledEventStrategy other && Equals(other); - /// - public bool Equals(ScheduledEventStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs deleted file mode 100644 index 24e5b3ddb068..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Severity.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Severity of the issue. - public readonly partial struct Severity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Severity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WarningValue = "Warning"; - private const string ErrorValue = "Error"; - - /// Warning. - public static Severity Warning { get; } = new Severity(WarningValue); - /// Error. - public static Severity Error { get; } = new Severity(ErrorValue); - /// Determines if two values are the same. - public static bool operator ==(Severity left, Severity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Severity left, Severity right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator Severity(string value) => new Severity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Severity other && Equals(other); - /// - public bool Equals(Severity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs deleted file mode 100644 index 153a5c103011..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// ThroughputPolicy to apply for throughput redistribution. - public readonly partial struct ThroughputPolicyType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ThroughputPolicyType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "none"; - private const string EqualValue = "equal"; - private const string CustomValue = "custom"; - - /// none. - public static ThroughputPolicyType None { get; } = new ThroughputPolicyType(NoneValue); - /// equal. - public static ThroughputPolicyType Equal { get; } = new ThroughputPolicyType(EqualValue); - /// custom. - public static ThroughputPolicyType Custom { get; } = new ThroughputPolicyType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(ThroughputPolicyType left, ThroughputPolicyType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ThroughputPolicyType left, ThroughputPolicyType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ThroughputPolicyType(string value) => new ThroughputPolicyType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThroughputPolicyType other && Equals(other); - /// - public bool Equals(ThroughputPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs deleted file mode 100644 index b25cf83d836c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolAccountsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ThroughputPoolAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - - internal static ThroughputPoolAccountsListResult DeserializeThroughputPoolAccountsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolAccountsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolAccountsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeThroughputPoolAccountsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs deleted file mode 100644 index e806ee3012a6..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the global database accounts and their properties. - internal partial class ThroughputPoolAccountsListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ThroughputPoolAccountsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of global database accounts in a throughput pool and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal ThroughputPoolAccountsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of global database accounts in a throughput pool and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs deleted file mode 100644 index 7cca36703583..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class ThroughputPoolsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - ThroughputPoolsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - - internal static ThroughputPoolsListResult DeserializeThroughputPoolsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ThroughputPoolsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{options.Format}' format."); - } - } - - ThroughputPoolsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeThroughputPoolsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs deleted file mode 100644 index b6490a57da21..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// The List operation response, that contains the throughput pools and their properties. - internal partial class ThroughputPoolsListResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ThroughputPoolsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// List of throughput pools and their properties. - /// The link used to get the next page of results. - /// Keeps track of any properties unknown to the library. - internal ThroughputPoolsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// List of throughput pools and their properties. - public IReadOnlyList Value { get; } - /// The link used to get the next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs index 2a6222569248..c5d39460d301 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs @@ -29,12 +29,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -111,7 +105,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -123,16 +116,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,7 +190,6 @@ internal static ThroughputSettingsUpdateData DeserializeThroughputSettingsUpdate tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -294,21 +276,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs index 499a10c81fc2..bbebf2c8ea00 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.cs @@ -66,12 +66,10 @@ public ThroughputSettingsUpdateData(AzureLocation location, ThroughputSettingsRe /// The tags. /// The location. /// The standard JSON format of a resource throughput. - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingsUpdateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -83,8 +81,5 @@ internal ThroughputSettingsUpdateData() /// The standard JSON format of a resource throughput. [WirePath("properties.resource")] public ThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs deleted file mode 100644 index 504a2110bb4d..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - internal partial class UnknownDataTransferDataSourceSink : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - - internal static UnknownDataTransferDataSourceSink DeserializeUnknownDataTransferDataSourceSink(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DataTransferComponent component = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("component"u8)) - { - component = new DataTransferComponent(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownDataTransferDataSourceSink(component, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Component), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" component: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" component: "); - builder.AppendLine($"'{Component.ToString()}'"); - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{options.Format}' format."); - } - } - - DataTransferDataSourceSink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDataTransferDataSourceSink(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs deleted file mode 100644 index a8a2c1cc8e3a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.CosmosDB.Models -{ - /// Unknown version of DataTransferDataSourceSink. - internal partial class UnknownDataTransferDataSourceSink : DataTransferDataSourceSink - { - /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal UnknownDataTransferDataSourceSink(DataTransferComponent component, IDictionary serializedAdditionalRawData) : base(component, serializedAdditionalRawData) - { - Component = component; - } - - /// Initializes a new instance of for deserialization. - internal UnknownDataTransferDataSourceSink() - { - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs index ee997ce5ea4c..6b9c4a4aff4f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string collectionName, Ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string collectionName, Can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string collectionName, CancellationToken ca /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs index 9dd32c56d83c..cf0757e4ef1e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static MongoDBCollectionData DeserializeMongoDBCollectionData(JsonEleme location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs index 452d855493a9..58cfa7149b2b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.cs @@ -66,13 +66,11 @@ public MongoDBCollectionData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBCollectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBCollectionResourceInfo resource, MongoDBCollectionPropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBCollectionData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBCollectionPropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs index ddb2971eeeb3..7300cc5c3570 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs @@ -111,7 +111,7 @@ public virtual MongoDBCollectionThroughputSettingResource GetMongoDBCollectionTh /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,98 +354,6 @@ public virtual ArmOperation Update(WaitUntil waitUnti } } - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetMongoDBCollectionPartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB Collection - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_ListMongoDBCollectionPartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation GetMongoDBCollectionPartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionResource.GetMongoDBCollectionPartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionPartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBCollectionMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionMongoDBResourcesRestClient.CreateListMongoDBCollectionPartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Retrieves continuous backup information for a Mongodb collection. /// @@ -459,7 +367,7 @@ public virtual ArmOperation GetMongoDBCo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -505,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -551,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -613,7 +521,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -675,7 +583,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -732,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -789,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -849,7 +757,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs index 8ef371b7d6fa..0a218ee08b92 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -263,190 +263,6 @@ public virtual ArmOperation CreateOr } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBContainerRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB container - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBContainerRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBContainerRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionThroughputSettingResource.MongoDBContainerRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.MongoDBContainerRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBCollectionThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBCollectionThroughputSettingMongoDBResourcesRestClient.CreateMongoDBContainerRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale /// @@ -460,7 +276,7 @@ public virtual ArmOperation MongoDBContai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -502,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -544,7 +360,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -586,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -628,7 +444,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -690,7 +506,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -752,7 +568,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -809,7 +625,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -866,7 +682,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -926,7 +742,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs index 7d7e3691b307..173a5e9e65b4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs index d18b18b64154..2f4459c8f3bd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -120,7 +114,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -133,16 +126,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +214,6 @@ internal static MongoDBDatabaseData DeserializeMongoDBDatabaseData(JsonElement e location, resource, options0, - identity, serializedAdditionalRawData); } @@ -318,21 +300,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs index 3963cf6b2ff2..fb4d46632fa2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.cs @@ -66,13 +66,11 @@ public MongoDBDatabaseData(AzureLocation location) : base(location) /// The location. /// /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MongoDBDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedMongoDBDatabaseResourceInfo resource, MongoDBDatabasePropertiesConfig options, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; Options = options; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,8 +85,5 @@ internal MongoDBDatabaseData() /// Gets or sets the options. [WirePath("properties.options")] public MongoDBDatabasePropertiesConfig Options { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index dcc165b61c55..896de9c85478 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual MongoDBCollectionCollection GetMongoDBCollections() /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetMongoDBCollect /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetMongoDBCollection(string c /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -422,98 +422,6 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } } - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Merges the partitions of a MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabasePartitionMerge - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); - scope.Start(); - try - { - var response = _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -527,7 +435,7 @@ public virtual ArmOperation MongoDBDatab /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -589,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -651,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -708,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -765,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -825,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs index ddf6835e2fdf..4ba8b808864e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -430,190 +430,6 @@ public virtual ArmOperation MigrateMon } } - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRetrieveThroughputDistributionAsync(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistributionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRetrieveThroughputDistribution(WaitUntil waitUntil, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRetrieveThroughputDistribution"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRetrieveThroughputDistribution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, retrieveThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual async Task> MongoDBDatabaseRedistributeThroughputAsync(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = await _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Redistribute throughput for an Azure Cosmos DB MongoDB database - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput - /// - /// - /// Operation Id - /// MongoDBResources_MongoDBDatabaseRedistributeThroughput - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation MongoDBDatabaseRedistributeThroughput(WaitUntil waitUntil, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var scope = _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseThroughputSettingResource.MongoDBDatabaseRedistributeThroughput"); - scope.Start(); - try - { - var response = _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.MongoDBDatabaseRedistributeThroughput(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters, cancellationToken); - var operation = new CosmosDBArmOperation(new PhysicalPartitionThroughputInfoResultOperationSource(), _mongoDBDatabaseThroughputSettingMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseThroughputSettingMongoDBResourcesRestClient.CreateMongoDBDatabaseRedistributeThroughputRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, redistributeThroughputParameters).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// @@ -627,7 +443,7 @@ public virtual ArmOperation MongoDBDataba /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -689,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -751,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -808,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -865,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -925,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs index bb07112b7d5a..63a30c70067b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoRoleDefin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoRoleDefinition /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoRoleDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs index b4abdcf03341..bff898a2bebf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs index a1c55ce0710f..a0b064c28bf1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoUserDefin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoUserDefinition /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoUserDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs index 44a91c404b34..4468316e23e8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs deleted file mode 100644 index 555f5dcfe433..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . - /// - public partial class NetworkSecurityPerimeterConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", NetworkSecurityPerimeterConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NetworkSecurityPerimeterConfigurationResource.ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != CosmosDBAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_List - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs deleted file mode 100644 index 0505e42a6b88..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties, options); - } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - - internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecurityPerimeterConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - NetworkSecurityPerimeterConfigurationProperties properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = NetworkSecurityPerimeterConfigurationProperties.DeserializeNetworkSecurityPerimeterConfigurationProperties(property.Value, options); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NetworkSecurityPerimeterConfigurationData( - id, - name, - type, - systemData, - properties, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" properties: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Properties)) - { - builder.Append(" properties: "); - BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{options.Format}' format."); - } - } - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs deleted file mode 100644 index 930f80e24c35..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.CosmosDB.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A class representing the NetworkSecurityPerimeterConfiguration data model. - /// Network security perimeter (NSP) configuration resource - /// - public partial class NetworkSecurityPerimeterConfigurationData : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NetworkSecurityPerimeterConfigurationData() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Network security configuration properties. - /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkSecurityPerimeterConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Network security configuration properties. - [WirePath("properties")] - public NetworkSecurityPerimeterConfigurationProperties Properties { get; set; } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs deleted file mode 100644 index cccb44eece95..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.CosmosDB -{ - public partial class NetworkSecurityPerimeterConfigurationResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs deleted file mode 100644 index cd74e30cd91c..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - /// - /// A Class representing a NetworkSecurityPerimeterConfiguration along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNetworkSecurityPerimeterConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. - /// - public partial class NetworkSecurityPerimeterConfigurationResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - /// The networkSecurityPerimeterConfigurationName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; - private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; - private readonly NetworkSecurityPerimeterConfigurationData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/networkSecurityPerimeterConfigurations"; - - /// Initializes a new instance of the class for mocking. - protected NetworkSecurityPerimeterConfigurationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, NetworkSecurityPerimeterConfigurationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); - _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual NetworkSecurityPerimeterConfigurationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets effective Network Security Perimeter Configuration for association - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Get - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task ReconcileAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = await _networkSecurityPerimeterConfigurationRestClient.ReconcileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Refreshes any information about the association. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile - /// - /// - /// Operation Id - /// NetworkSecurityPerimeterConfigurations_Reconcile - /// - /// - /// Default Api Version - /// 2024-05-15-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Reconcile(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); - scope.Start(); - try - { - var response = _networkSecurityPerimeterConfigurationRestClient.Reconcile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new CosmosDBArmOperation(_networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs index 37c9c1c9f375..3228f97a9ee2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraClustersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListBySubscriptionAsync( } /// List all managed Cassandra clusters in this subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ public async Task> ListByResourceGroupAsync } /// List all managed Cassandra clusters in this resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -331,7 +331,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -356,7 +356,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -419,7 +419,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// 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. @@ -446,7 +446,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// 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. @@ -511,7 +511,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -538,7 +538,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates some of the properties of a managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Parameters to provide for specifying the managed Cassandra cluster. @@ -605,7 +605,7 @@ internal HttpMessage CreateInvokeCommandRequest(string subscriptionId, string re } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -631,7 +631,7 @@ public async Task InvokeCommandAsync(string subscriptionId, string res } /// Invoke a command like nodetool for cassandra maintenance. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Specification which command to run where. @@ -656,395 +656,7 @@ public Response InvokeCommand(string subscriptionId, string resourceGroupName, s } } - internal RequestUriBuilder CreateListCommandRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - 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("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListCommandRequest(string subscriptionId, 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("/commands", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all commands currently running on ring info. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListCommand(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListCommandRequest(subscriptionId, resourceGroupName, clusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCommandAsyncRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - 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("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetCommandAsyncRequest(string subscriptionId, string resourceGroupName, string clusterName, string commandId) - { - 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("/commands/", false); - uri.AppendPath(commandId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCommandAsyncAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get details about a specified command that was run asynchronously. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// Managed Cassandra cluster command id. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCommandAsync(string subscriptionId, string resourceGroupName, string clusterName, string commandId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(commandId, nameof(commandId)); - - using var message = CreateGetCommandAsyncRequest(subscriptionId, resourceGroupName, clusterName, commandId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ListCommands value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ListCommands.DeserializeListCommands(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBackupsRequestUri(string subscriptionId, string resourceGroupName, string clusterName) - { - 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); - return uri; - } - - internal HttpMessage CreateListBackupsRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListBackupsAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - /// List the backups of this cluster that are available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Managed Cassandra cluster name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListBackups(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - - using var message = CreateListBackupsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetBackupRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string backupId) - { - 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); - return uri; - } - - internal HttpMessage CreateGetBackupRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetBackupAsync(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the properties of an individual backup of this cluster that is available to restore. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetBackup(string subscriptionId, string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(backupId, nameof(backupId)); - - using var message = CreateGetBackupRequest(subscriptionId, resourceGroupName, clusterName, backupId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraClusterBackupResourceInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CassandraClusterBackupResourceInfo.DeserializeCassandraClusterBackupResourceInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1059,7 +671,7 @@ internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, str return uri; } - internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate) + internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1075,30 +687,25 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou uri.AppendPath("/deallocate", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - if (xMsForceDeallocate != null) - { - request.Headers.Add("x-ms-force-deallocate", xMsForceDeallocate); - } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1110,20 +717,19 @@ public async Task DeallocateAsync(string subscriptionId, string resour } /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. - /// Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, string xMsForceDeallocate = null, CancellationToken cancellationToken = default) + public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, xMsForceDeallocate); + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1171,7 +777,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1195,7 +801,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1255,7 +861,7 @@ internal HttpMessage CreateStatusRequest(string subscriptionId, string resourceG } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -1284,7 +890,7 @@ public async Task> StatusAsync(string sub } /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs index e114b44fe1d2..c094e33c387c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraDataCentersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subs } /// List all data centers in a particular managed Cassandra cluster. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscriptio } /// Get the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -273,7 +273,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -300,7 +300,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -369,7 +369,7 @@ internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string res } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -398,7 +398,7 @@ public async Task CreateUpdateAsync(string subscriptionId, string reso } /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -469,7 +469,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. @@ -498,7 +498,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update some of the properties of a managed Cassandra data center. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Managed Cassandra cluster name. /// Data center name in a managed Cassandra cluster. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs index f86f4c50afc7..cb18745dd4eb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs @@ -32,7 +32,7 @@ public CassandraResourcesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListCassandraKeyspacesRequest(string subscriptionId, } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListCassandraKeyspacesA } /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetCassandraKeyspaceRequest(string subscriptionId, st } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -202,7 +202,7 @@ public async Task> GetCassandraKeyspaceAsync(str } /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateCassandraKeyspaceRequest(string subscript } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -306,7 +306,7 @@ public async Task CreateUpdateCassandraKeyspaceAsync(string subscripti } /// Create or update an Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteCassandraKeyspaceRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -399,7 +399,7 @@ public async Task DeleteCassandraKeyspaceAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB Cassandra keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetCassandraKeyspaceThroughputRequest(string subscrip } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -499,7 +499,7 @@ public async Task> GetCassandraKeyspaceThroughpu } /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateCassandraKeyspaceThroughputRequest(string subsc } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -605,7 +605,7 @@ public async Task UpdateCassandraKeyspaceThroughputAsync(string subscr } /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -701,7 +701,7 @@ public async Task MigrateCassandraKeyspaceToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -795,7 +795,7 @@ public async Task MigrateCassandraKeyspaceToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListCassandraTablesRequest(string subscriptionId, str } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -893,7 +893,7 @@ public async Task> ListCassandraTablesAsync(s } /// Lists the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetCassandraTableRequest(string subscriptionId, strin } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1001,7 +1001,7 @@ public async Task> GetCassandraTableAsync(string su } /// Gets the Cassandra table under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateCassandraTableRequest(string subscription } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateCassandraTableAsync(string subscriptionI } /// Create or update an Azure Cosmos DB Cassandra Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteCassandraTableRequest(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1214,7 +1214,7 @@ public async Task DeleteCassandraTableAsync(string subscriptionId, str } /// Deletes an existing Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetCassandraTableThroughputRequest(string subscriptio } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1322,7 +1322,7 @@ public async Task> GetCassandraTableThroughputAs } /// Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateCassandraTableThroughputRequest(string subscrip } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1436,7 +1436,7 @@ public async Task UpdateCassandraTableThroughputAsync(string subscript } /// Update RUs per second of an Azure Cosmos DB Cassandra table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateCassandraTableToAutoscaleRequest(string subscr } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1540,7 +1540,7 @@ public async Task MigrateCassandraTableToAutoscaleAsync(string subscri } /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateCassandraTableToManualThroughputRequest(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1642,7 +1642,7 @@ public async Task MigrateCassandraTableToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB keyspace name. @@ -1669,856 +1669,5 @@ public Response MigrateCassandraTableToManualThroughput(string subscriptionId, s throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListCassandraViewsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName) - { - 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); - return uri; - } - - internal HttpMessage CreateListCassandraViewsRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListCassandraViewsAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListCassandraViews(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - - using var message = CreateListCassandraViewsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - 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); - return uri; - } - - internal HttpMessage CreateGetCassandraViewRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Cassandra view under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CassandraViewGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CassandraViewGetResultData.DeserializeCassandraViewGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CassandraViewGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - 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); - return uri; - } - - internal HttpMessage CreateCreateUpdateCassandraViewRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content) - { - 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 content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Cassandra View. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteCassandraViewRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - 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); - return uri; - } - - internal HttpMessage CreateDeleteCassandraViewRequest(string subscriptionId, 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; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteCassandraViewAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteCassandraView(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateDeleteCassandraViewRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - 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); - return uri; - } - - internal HttpMessage CreateGetCassandraViewThroughputRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateGetCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputSettingData.DeserializeThroughputSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ThroughputSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateCassandraViewThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - 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); - return uri; - } - - internal HttpMessage CreateUpdateCassandraViewThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data) - { - 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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task UpdateCassandraViewThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update RUs per second of an Azure Cosmos DB Cassandra view. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response UpdateCassandraViewThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateCassandraViewThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToAutoscaleRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - 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); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToAutoscaleRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToAutoscaleAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToAutoscale(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToAutoscaleRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMigrateCassandraViewToManualThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName) - { - 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); - return uri; - } - - internal HttpMessage CreateMigrateCassandraViewToManualThroughputRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MigrateCassandraViewToManualThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MigrateCassandraViewToManualThroughput(string subscriptionId, string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(keyspaceName, nameof(keyspaceName)); - Argument.AssertNotNullOrEmpty(viewName, nameof(viewName)); - - using var message = CreateMigrateCassandraViewToManualThroughputRequest(subscriptionId, resourceGroupName, accountName, keyspaceName, viewName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs index 43bbb97dd5b6..1388f29eb9d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs index 83fb5bb662b6..16653cbf2a6d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscr } /// Retrieves the usages (most recent storage data) for the given collection, split by partition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs index 2ce913c43c8c..8150f6fa27b8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRegionRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account, collection and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs index 4c5b28b60cd1..bbf77994265b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -205,7 +205,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -239,7 +239,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent storage data) for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -317,7 +317,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -350,7 +350,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs deleted file mode 100644 index 23d2c6492585..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs +++ /dev/null @@ -1,837 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class DataTransferJobsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DataTransferJobsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DataTransferJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The to use. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string accountName, string jobName, DataTransferJobGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DataTransferJobGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/pause", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> PauseAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Pause a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Pause(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/resume", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ResumeAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Resumes a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Resume(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CancelAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancels a Data Transfer Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCompleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCompleteRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) - { - 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("/dataTransferJobs/", false); - uri.AppendPath(jobName, true); - uri.AppendPath("/complete", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CompleteAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Completes a Data Transfer Online Job. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Name of the Data Transfer Job. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Complete(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); - - using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobGetResultData.DeserializeDataTransferJobGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - 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("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, 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("/dataTransferJobs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccount(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByDatabaseAccountNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByDatabaseAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByDatabaseAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Data Transfer jobs. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByDatabaseAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DataTransferJobFeedResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DataTransferJobFeedResults.DeserializeDataTransferJobFeedResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs index 0f7889b8f2ab..79a148984ca1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountRegionRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs index 95689de3d1f5..47b5dfc91896 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -71,7 +71,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> GetAsync(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -171,7 +171,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -197,7 +197,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates the properties of an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -261,7 +261,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -287,7 +287,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The parameters to provide for the current database account. @@ -346,7 +346,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -371,7 +371,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -435,7 +435,7 @@ internal HttpMessage CreateFailoverPriorityChangeRequest(string subscriptionId, } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -462,7 +462,7 @@ public async Task FailoverPriorityChangeAsync(string subscriptionId, s } /// Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The new failover policies for the database account. @@ -517,7 +517,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -542,7 +542,7 @@ public async Task> ListAsync(string subscri } /// Lists all the Azure Cosmos DB database accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -599,7 +599,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -626,7 +626,7 @@ public async Task> ListByResourceGroupAsync } /// Lists all the Azure Cosmos DB database accounts available under the given resource group. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -689,7 +689,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -718,7 +718,7 @@ public async Task> ListKeysAsync(string subscri } /// Lists the access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -783,7 +783,7 @@ internal HttpMessage CreateListConnectionStringsRequest(string subscriptionId, s } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -812,7 +812,7 @@ public async Task> ListConn } /// Lists the connection strings for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -881,7 +881,7 @@ internal HttpMessage CreateOfflineRegionRequest(string subscriptionId, string re } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -908,7 +908,7 @@ public async Task OfflineRegionAsync(string subscriptionId, string res } /// Offline the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to offline for the database account. @@ -975,7 +975,7 @@ internal HttpMessage CreateOnlineRegionRequest(string subscriptionId, string res } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1002,7 +1002,7 @@ public async Task OnlineRegionAsync(string subscriptionId, string reso } /// Online the specified region for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region to online for the database account. @@ -1065,7 +1065,7 @@ internal HttpMessage CreateListReadOnlyKeysRequest(string subscriptionId, string } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1094,7 +1094,7 @@ public async Task> ListReadOnlyKeysAsyn } /// Lists the read-only access keys for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1162,7 +1162,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1189,7 +1189,7 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res } /// Regenerates an access key for the specified Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the key to regenerate. @@ -1335,7 +1335,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1366,7 +1366,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -1441,7 +1441,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1471,7 +1471,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). @@ -1537,7 +1537,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -1566,7 +1566,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs index 1fbf628f825b..e2c2bc9414fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string su } /// Retrieves the metrics determined by the given filter for the given database account and database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -193,7 +193,7 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -225,7 +225,7 @@ public async Task> ListUsagesAsync(string subscri } /// Retrieves the usages (most recent data) for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -297,7 +297,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string subscriptionId, s } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -328,7 +328,7 @@ public async Task> ListMetricDefin } /// Retrieves metric definitions for the given database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs deleted file mode 100644 index 3c4e3daee46f..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs +++ /dev/null @@ -1,430 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class GraphResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GraphResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GraphResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListGraphsRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - 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); - return uri; - } - - internal HttpMessage CreateListGraphsRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListGraphsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - /// Lists the graphs under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListGraphs(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListGraphsRequest(subscriptionId, 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 new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - 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); - return uri; - } - - internal HttpMessage CreateGetGraphRequest(string subscriptionId, 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"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateGetGraphRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GraphResourceGetResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GraphResourceGetResultData.DeserializeGraphResourceGetResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GraphResourceGetResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateGraphRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - 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); - return uri; - } - - internal HttpMessage CreateCreateUpdateGraphRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content) - { - 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("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateGraphAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB Graph. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateGraph(string subscriptionId, string resourceGroupName, string accountName, string graphName, GraphResourceGetResultCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateGraphRequest(subscriptionId, resourceGroupName, accountName, graphName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteGraphResourceRequestUri(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - 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); - return uri; - } - - internal HttpMessage CreateDeleteGraphResourceRequest(string subscriptionId, string resourceGroupName, string accountName, string graphName) - { - 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("/graphs/", false); - uri.AppendPath(graphName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteGraphResourceAsync(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Graph Resource. - /// The ID of the target subscription. The value must be an UUID. - /// 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. - /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteGraphResource(string subscriptionId, string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(graphName, nameof(graphName)); - - using var message = CreateDeleteGraphResourceRequest(subscriptionId, resourceGroupName, accountName, graphName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs index f7d826a0d2f1..40b7045b734e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public GremlinResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListGremlinDatabasesRequest(string subscriptionId, st } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListGremlinDatabasesAsync } /// Lists the Gremlin databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetGremlinDatabaseRequest(string subscriptionId, stri } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetGremlinDatabaseAsync(string } /// Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateGremlinDatabaseRequest(string subscriptio } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateGremlinDatabaseAsync(string subscription } /// Create or update an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteGremlinDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteGremlinDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetGremlinDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetGremlinDatabaseThroughputA } /// Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateGremlinDatabaseThroughputRequest(string subscri } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateGremlinDatabaseThroughputAsync(string subscrip } /// Update RUs per second of an Azure Cosmos DB Gremlin database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateGremlinDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateGremlinDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateGremlinDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -862,7 +862,7 @@ internal HttpMessage CreateListGremlinGraphsRequest(string subscriptionId, strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -893,7 +893,7 @@ public async Task> ListGremlinGraphsAsync(strin } /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -966,7 +966,7 @@ internal HttpMessage CreateGetGremlinGraphRequest(string subscriptionId, string } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1001,7 +1001,7 @@ public async Task> GetGremlinGraphAsync(string subscr } /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1082,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateGremlinGraphRequest(string subscriptionId } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1113,7 +1113,7 @@ public async Task CreateUpdateGremlinGraphAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1185,7 +1185,7 @@ internal HttpMessage CreateDeleteGremlinGraphRequest(string subscriptionId, stri } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1214,7 +1214,7 @@ public async Task DeleteGremlinGraphAsync(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1287,7 +1287,7 @@ internal HttpMessage CreateGetGremlinGraphThroughputRequest(string subscriptionI } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1322,7 +1322,7 @@ public async Task> GetGremlinGraphThroughputAsyn } /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1405,7 +1405,7 @@ internal HttpMessage CreateUpdateGremlinGraphThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1436,7 +1436,7 @@ public async Task UpdateGremlinGraphThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB Gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1511,7 +1511,7 @@ internal HttpMessage CreateMigrateGremlinGraphToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1540,7 +1540,7 @@ public async Task MigrateGremlinGraphToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1613,7 +1613,7 @@ internal HttpMessage CreateMigrateGremlinGraphToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1642,7 +1642,7 @@ public async Task MigrateGremlinGraphToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1719,7 +1719,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1750,7 +1750,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a gremlin graph. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs index ea7f7af84c3f..6513d90111c1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs @@ -32,7 +32,7 @@ public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListAsync(string subscri } /// List Cosmos DB locations and their properties. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -145,7 +145,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -173,7 +173,7 @@ public async Task> GetAsync(string subscriptionId } /// Get the properties of an existing Cosmos DB location. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs index 18b5efa6de60..e86c6cd05558 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs @@ -32,7 +32,7 @@ public MongoDBResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListMongoDBDatabasesRequest(string subscriptionId, st } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListMongoDBDatabasesAsync } /// Lists the MongoDB databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetMongoDBDatabaseRequest(string subscriptionId, stri } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetMongoDBDatabaseAsync(string } /// Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateMongoDBDatabaseRequest(string subscriptio } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateMongoDBDatabaseAsync(string subscription } /// Create or updates Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteMongoDBDatabaseRequest(string subscriptionId, s } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteMongoDBDatabaseAsync(string subscriptionId, st } /// Deletes an existing Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetMongoDBDatabaseThroughputRequest(string subscripti } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetMongoDBDatabaseThroughputA } /// Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateMongoDBDatabaseThroughputRequest(string subscri } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateMongoDBDatabaseThroughputAsync(string subscrip } /// Update RUs per second of the an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToAutoscaleRequest(string subsc } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateMongoDBDatabaseToAutoscaleAsync(string subscr } /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateMongoDBDatabaseToManualThroughputRequest(strin } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateMongoDBDatabaseToManualThroughputAsync(string } /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,430 +821,6 @@ public Response MigrateMongoDBDatabaseToManualThroughput(string subscriptionId, } } - internal RequestUriBuilder CreateMongoDBDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", 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(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", 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(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current MongoDB database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", 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(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for retrieving throughput distribution for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateMongoDBContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateMongoDBContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", 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(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Redistribute throughput for an Azure Cosmos DB MongoDB container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters to provide for redistributing throughput for the current MongoDB container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response MongoDBContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - - using var message = CreateMongoDBContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListMongoDBCollectionsRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1286,7 +862,7 @@ internal HttpMessage CreateListMongoDBCollectionsRequest(string subscriptionId, } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1317,7 +893,7 @@ public async Task> ListMongoDBCollectionsA } /// Lists the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1390,7 +966,7 @@ internal HttpMessage CreateGetMongoDBCollectionRequest(string subscriptionId, st } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1425,7 +1001,7 @@ public async Task> GetMongoDBCollectionAsync(str } /// Gets the MongoDB collection under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1506,7 +1082,7 @@ internal HttpMessage CreateCreateUpdateMongoDBCollectionRequest(string subscript } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1537,7 +1113,7 @@ public async Task CreateUpdateMongoDBCollectionAsync(string subscripti } /// Create or update an Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1609,7 +1185,7 @@ internal HttpMessage CreateDeleteMongoDBCollectionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1638,7 +1214,7 @@ public async Task DeleteMongoDBCollectionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1666,218 +1242,6 @@ public Response DeleteMongoDBCollection(string subscriptionId, string resourceGr } } - internal RequestUriBuilder CreateMongoDBDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateMongoDBDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", 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(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task MongoDBDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response MongoDBDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListMongoDBCollectionPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListMongoDBCollectionPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) - { - 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("/mongodbDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/collections/", false); - uri.AppendPath(collectionName, true); - uri.AppendPath("/partitionMerge", 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(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListMongoDBCollectionPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Merges the partitions of a MongoDB Collection. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB collection name. - /// The parameters for the merge operation. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListMongoDBCollectionPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(collectionName, nameof(collectionName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - - using var message = CreateListMongoDBCollectionPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, collectionName, mergeParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetMongoDBCollectionThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName) { var uri = new RawRequestUriBuilder(); @@ -1923,7 +1287,7 @@ internal HttpMessage CreateGetMongoDBCollectionThroughputRequest(string subscrip } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1958,7 +1322,7 @@ public async Task> GetMongoDBCollectionThroughpu } /// Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2041,7 +1405,7 @@ internal HttpMessage CreateUpdateMongoDBCollectionThroughputRequest(string subsc } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2072,7 +1436,7 @@ public async Task UpdateMongoDBCollectionThroughputAsync(string subscr } /// Update the RUs per second of an Azure Cosmos DB MongoDB collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1511,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToAutoscaleRequest(string sub } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1540,7 @@ public async Task MigrateMongoDBCollectionToAutoscaleAsync(string subs } /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2249,7 +1613,7 @@ internal HttpMessage CreateMigrateMongoDBCollectionToManualThroughputRequest(str } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2278,7 +1642,7 @@ public async Task MigrateMongoDBCollectionToManualThroughputAsync(stri } /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2345,7 +1709,7 @@ internal HttpMessage CreateGetMongoRoleDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2378,7 +1742,7 @@ public async Task> GetMongoRoleDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2453,7 +1817,7 @@ internal HttpMessage CreateCreateUpdateMongoRoleDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2482,7 +1846,7 @@ public async Task CreateUpdateMongoRoleDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2549,7 +1913,7 @@ internal HttpMessage CreateDeleteMongoRoleDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2577,7 +1941,7 @@ public async Task DeleteMongoRoleDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the Role Definition {dbName.roleName}. @@ -2641,7 +2005,7 @@ internal HttpMessage CreateListMongoRoleDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2670,7 +2034,7 @@ public async Task> ListMongoRoleDefini } /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -2737,7 +2101,7 @@ internal HttpMessage CreateGetMongoUserDefinitionRequest(string subscriptionId, } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2770,7 +2134,7 @@ public async Task> GetMongoUserDefinitionAsy } /// Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2845,7 +2209,7 @@ internal HttpMessage CreateCreateUpdateMongoUserDefinitionRequest(string subscri } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2874,7 +2238,7 @@ public async Task CreateUpdateMongoUserDefinitionAsync(string subscrip } /// Creates or updates an Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2941,7 +2305,7 @@ internal HttpMessage CreateDeleteMongoUserDefinitionRequest(string subscriptionI } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -2969,7 +2333,7 @@ public async Task DeleteMongoUserDefinitionAsync(string subscriptionId } /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The ID for the User Definition {dbName.userName}. @@ -3033,7 +2397,7 @@ internal HttpMessage CreateListMongoUserDefinitionsRequest(string subscriptionId } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3062,7 +2426,7 @@ public async Task> ListMongoUserDefini } /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -3139,7 +2503,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3170,7 +2534,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a Mongodb collection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs deleted file mode 100644 index 75eafcfdbb73..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ /dev/null @@ -1,413 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class NetworkSecurityPerimeterConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of NetworkSecurityPerimeterConfigurationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - 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("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, 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("/networkSecurityPerimeterConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - 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("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - 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("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets effective Network Security Perimeter Configuration for association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateReconcileRequestUri(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - 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("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateReconcileRequest(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName) - { - 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("/networkSecurityPerimeterConfigurations/", false); - uri.AppendPath(networkSecurityPerimeterConfigurationName, true); - uri.AppendPath("/reconcile", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task ReconcileAsync(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Refreshes any information about the association. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Reconcile(string subscriptionId, string resourceGroupName, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); - - using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of effective Network Security Perimeter Configuration for cosmos db account. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NetworkSecurityPerimeterConfigurationListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = NetworkSecurityPerimeterConfigurationListResult.DeserializeNetworkSecurityPerimeterConfigurationListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs index 3a9f8b7f7979..cc5674239302 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -91,7 +91,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. @@ -130,7 +130,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id and region. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs index 4ec5dc1b5dc5..160553e8dc35 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. @@ -124,7 +124,7 @@ public async Task> ListMetricsAsync(string s } /// Retrieves the metrics determined by the given filter for the given partition key range id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database rid. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs index b33d0dbf8f72..cfd158347f9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs @@ -32,7 +32,7 @@ public PercentileRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. @@ -106,7 +106,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs index cf7823c7b454..767b264c29dd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileSourceTargetRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -118,7 +118,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs index e75329ed2dfc..b2bb1421dd51 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileTargetRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateListMetricsRequest(string subscriptionId, string reso } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ public async Task> ListMetricsAsync(string } /// Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index c2a9794bf6f0..1446864e2432 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByD } /// List all private endpoint connections on a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -202,7 +202,7 @@ public async Task> GetAsync(stri } /// Gets a private endpoint connection. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -306,7 +306,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. @@ -400,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a private endpoint connection with a given name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private endpoint connection. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index db278d29df8e..677d08ce454c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, s } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByDatabas } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. @@ -202,7 +202,7 @@ public async Task> GetAsync(string sub } /// Gets the private link resources that need to be created for a Cosmos DB account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The name of the private link resource. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs index 3079cb29a7ec..81a7f886b120 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableDatabaseAccountsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> ListByLocation } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The cancellation token to use. /// is null. @@ -149,7 +149,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -174,7 +174,7 @@ public async Task> ListAsync(stri } /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -233,7 +233,7 @@ internal HttpMessage CreateGetByLocationRequest(string subscriptionId, AzureLoca } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -262,7 +262,7 @@ public async Task> GetByLocationAsync(st } /// Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs index 198c935563f5..cd249101e371 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs index cc0c17ab09ba..01e0266feeda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinGraphsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the Gremlin database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs index 7d77385228c0..f6f8f63be244 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs index 245d89c8938f..1062e9947c46 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbCollectionsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. @@ -127,7 +127,7 @@ public async Task> ListAsync(st } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the MongoDB database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs index d2050697309f..4569c1fe6588 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(stri } /// Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs index 668cb3e6382e..bebf2c9ff247 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(stri } /// Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs index a64786530374..fbe040e9cdb4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -97,7 +97,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. @@ -127,7 +127,7 @@ public async Task> ListAsync(string } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The resource ID of the SQL database. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs index dc72044aaf63..45ee7cc32141 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlDatabasesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. @@ -100,7 +100,7 @@ public async Task> ListAsync(string s } /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The cancellation token to use. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs index c049d5f1d039..951564093e73 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlResourcesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string s } /// Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs index 3287cd3e7756..bdae7da87a13 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTableResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. @@ -118,7 +118,7 @@ public async Task> ListAsync(string } /// Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// The location where the restorable resources are located. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs index 03a782605338..f1affb795441 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTablesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. @@ -118,7 +118,7 @@ public async Task> ListAsync(string subscri } /// Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// Cosmos DB region, with spaces between words and each word capitalized. /// The instanceId GUID of a restorable database account. /// Restorable Tables event feed start time. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs index c0f17bb98994..5db447f80f23 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs @@ -32,7 +32,7 @@ public ServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscrip } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -173,7 +173,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -202,7 +202,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -269,7 +269,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -302,7 +302,7 @@ public async Task> GetAsync(string subscriptionId, } /// Gets the status of service. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -373,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. @@ -401,7 +401,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes service with the given serviceName. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB service name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs index 71c82039a2be..9ee1481bc318 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SqlResourcesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListSqlDatabasesRequest(string subscriptionId, string } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListSqlDatabasesAsync } /// Lists the SQL databases under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetSqlDatabaseRequest(string subscriptionId, string r } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -202,7 +202,7 @@ public async Task> GetSqlDatabaseAsync(string } /// Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateSqlDatabaseRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -306,7 +306,7 @@ public async Task CreateUpdateSqlDatabaseAsync(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteSqlDatabaseRequest(string subscriptionId, strin } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -399,7 +399,7 @@ public async Task DeleteSqlDatabaseAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetSqlDatabaseThroughputRequest(string subscriptionId } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -499,7 +499,7 @@ public async Task> GetSqlDatabaseThroughputAsync } /// Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateSqlDatabaseThroughputRequest(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -605,7 +605,7 @@ public async Task UpdateSqlDatabaseThroughputAsync(string subscription } /// Update RUs per second of an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToAutoscaleRequest(string subscript } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -701,7 +701,7 @@ public async Task MigrateSqlDatabaseToAutoscaleAsync(string subscripti } /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateSqlDatabaseToManualThroughputRequest(string su } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -795,7 +795,7 @@ public async Task MigrateSqlDatabaseToManualThroughputAsync(string sub } /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -821,328 +821,6 @@ public Response MigrateSqlDatabaseToManualThroughput(string subscriptionId, stri } } - internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - - using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ClientEncryptionKeysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - - using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBSqlClientEncryptionKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/clientEncryptionKeys/", false); - uri.AppendPath(clientEncryptionKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB ClientEncryptionKey name. - /// The parameters to provide for the client encryption key. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListSqlContainersRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); @@ -1184,7 +862,7 @@ internal HttpMessage CreateListSqlContainersRequest(string subscriptionId, strin } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1215,7 +893,7 @@ public async Task> ListSqlContainersAsy } /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1288,7 +966,7 @@ internal HttpMessage CreateGetSqlContainerRequest(string subscriptionId, string } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1323,7 +1001,7 @@ public async Task> GetSqlContainerAsync(strin } /// Gets the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1395,237 +1073,34 @@ internal HttpMessage CreateCreateUpdateSqlContainerRequest(string subscriptionId uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for the current SQL container. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// Cosmos DB container name. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - - using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabasePartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/partitionMerge", 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(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1637,24 +1112,26 @@ public async Task SqlDatabasePartitionMergeAsync(string subscriptionId } } - /// Merges the partitions of a SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update an Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters for the merge operation. + /// Cosmos DB container name. + /// The parameters to provide for the current SQL container. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CosmosDBSqlContainerCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + using var message = CreateCreateUpdateSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1666,7 +1143,7 @@ public Response SqlDatabasePartitionMerge(string subscriptionId, string resource } } - internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal RequestUriBuilder CreateDeleteSqlContainerRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1680,16 +1157,15 @@ internal RequestUriBuilder CreateListSqlContainerPartitionMergeRequestUri(string uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) + internal HttpMessage CreateDeleteSqlContainerRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -1702,74 +1178,64 @@ internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscrip uri.AppendPath(databaseName, true); uri.AppendPath("/containers/", false); uri.AppendPath(containerName, true); - uri.AppendPath("/partitionMerge", 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(mergeParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task ListSqlContainerPartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public async Task DeleteSqlContainerAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Merges the partitions of a SQL Container. - /// The ID of the target subscription. The value must be an UUID. + /// Deletes an existing Azure Cosmos DB SQL container. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. /// Cosmos DB container name. - /// The parameters for the merge operation. /// The cancellation token to use. - /// , , , , or is null. + /// , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response ListSqlContainerPartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + public Response DeleteSqlContainer(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); - using var message = CreateListSqlContainerPartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, mergeParameters); + using var message = CreateDeleteSqlContainerRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -1821,7 +1287,7 @@ internal HttpMessage CreateGetSqlContainerThroughputRequest(string subscriptionI } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1856,7 +1322,7 @@ public async Task> GetSqlContainerThroughputAsyn } /// Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1939,7 +1405,7 @@ internal HttpMessage CreateUpdateSqlContainerThroughputRequest(string subscripti } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -1970,7 +1436,7 @@ public async Task UpdateSqlContainerThroughputAsync(string subscriptio } /// Update RUs per second of an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2045,7 +1511,7 @@ internal HttpMessage CreateMigrateSqlContainerToAutoscaleRequest(string subscrip } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2074,7 +1540,7 @@ public async Task MigrateSqlContainerToAutoscaleAsync(string subscript } /// Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2147,7 +1613,7 @@ internal HttpMessage CreateMigrateSqlContainerToManualThroughputRequest(string s } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2176,7 +1642,7 @@ public async Task MigrateSqlContainerToManualThroughputAsync(string su } /// Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2204,109 +1670,7 @@ public Response MigrateSqlContainerToManualThroughput(string subscriptionId, str } } - internal RequestUriBuilder CreateSqlDatabaseRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateSqlDatabaseRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters) - { - 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("/sqlDatabases/", false); - uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", 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(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieve throughput distribution for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB database account name. - /// Cosmos DB database name. - /// The parameters to provide for retrieving throughput distribution for the current SQL database. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); - - using var message = CreateSqlDatabaseRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, retrieveThroughputParameters); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateListClientEncryptionKeysRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2318,16 +1682,16 @@ internal RequestUriBuilder CreateSqlDatabaseRedistributeThroughputRequestUri(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateListClientEncryptionKeysRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2338,77 +1702,77 @@ internal HttpMessage CreateSqlDatabaseRedistributeThroughputRequest(string subsc uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys", 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(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task SqlDatabaseRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public async Task> ListClientEncryptionKeysAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Redistribute throughput for an Azure Cosmos DB SQL database. - /// The ID of the target subscription. The value must be an UUID. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// The parameters to provide for redistributing throughput for the current SQL database. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response SqlDatabaseRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + public Response ListClientEncryptionKeys(string subscriptionId, string resourceGroupName, string accountName, string databaseName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); - using var message = CreateSqlDatabaseRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + using var message = CreateListClientEncryptionKeysRequest(subscriptionId, resourceGroupName, accountName, databaseName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ClientEncryptionKeysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ClientEncryptionKeysListResult.DeserializeClientEncryptionKeysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal RequestUriBuilder CreateGetClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2420,18 +1784,17 @@ internal RequestUriBuilder CreateSqlContainerRetrieveThroughputDistributionReque uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters) + internal HttpMessage CreateGetClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2442,83 +1805,86 @@ internal HttpMessage CreateSqlContainerRetrieveThroughputDistributionRequest(str uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/retrieveThroughputDistribution", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, 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(retrieveThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRetrieveThroughputDistributionAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieve throughput distribution for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for retrieving throughput distribution for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRetrieveThroughputDistribution(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RetrieveThroughputParameters retrieveThroughputParameters, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(retrieveThroughputParameters, nameof(retrieveThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); - using var message = CreateSqlContainerRetrieveThroughputDistributionRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + using var message = CreateGetClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + CosmosDBSqlClientEncryptionKeyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CosmosDBSqlClientEncryptionKeyData.DeserializeCosmosDBSqlClientEncryptionKeyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBSqlClientEncryptionKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal RequestUriBuilder CreateCreateUpdateClientEncryptionKeyRequestUri(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -2530,18 +1896,17 @@ internal RequestUriBuilder CreateSqlContainerRedistributeThroughputRequestUri(st uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters) + internal HttpMessage CreateCreateUpdateClientEncryptionKeyRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -2552,40 +1917,39 @@ internal HttpMessage CreateSqlContainerRedistributeThroughputRequest(string subs uri.AppendPath(accountName, true); uri.AppendPath("/sqlDatabases/", false); uri.AppendPath(databaseName, true); - uri.AppendPath("/containers/", false); - uri.AppendPath(containerName, true); - uri.AppendPath("/throughputSettings/default/redistributeThroughput", false); + uri.AppendPath("/clientEncryptionKeys/", false); + uri.AppendPath(clientEncryptionKeyName, 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(redistributeThroughputParameters, ModelSerializationExtensions.WireOptions); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task SqlContainerRedistributeThroughputAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateClientEncryptionKeyAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -2597,26 +1961,26 @@ public async Task SqlContainerRedistributeThroughputAsync(string subsc } } - /// Redistribute throughput for an Azure Cosmos DB SQL container. - /// The ID of the target subscription. The value must be an UUID. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. - /// Cosmos DB container name. - /// The parameters to provide for redistributing throughput for the current SQL container. + /// Cosmos DB ClientEncryptionKey name. + /// The parameters to provide for the client encryption key. /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response SqlContainerRedistributeThroughput(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, RedistributeThroughputParameters redistributeThroughputParameters, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateClientEncryptionKey(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); - Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); - Argument.AssertNotNull(redistributeThroughputParameters, nameof(redistributeThroughputParameters)); + Argument.AssertNotNullOrEmpty(clientEncryptionKeyName, nameof(clientEncryptionKeyName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateSqlContainerRedistributeThroughputRequest(subscriptionId, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters); + using var message = CreateCreateUpdateClientEncryptionKeyRequest(subscriptionId, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -2673,7 +2037,7 @@ internal HttpMessage CreateListSqlStoredProceduresRequest(string subscriptionId, } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2706,7 +2070,7 @@ public async Task> ListSqlStoredP } /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2785,7 +2149,7 @@ internal HttpMessage CreateGetSqlStoredProcedureRequest(string subscriptionId, s } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2822,7 +2186,7 @@ public async Task> GetSqlStoredProcedur } /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2909,7 +2273,7 @@ internal HttpMessage CreateCreateUpdateSqlStoredProcedureRequest(string subscrip } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -2942,7 +2306,7 @@ public async Task CreateUpdateSqlStoredProcedureAsync(string subscript } /// Create or update an Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3020,7 +2384,7 @@ internal HttpMessage CreateDeleteSqlStoredProcedureRequest(string subscriptionId } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3051,7 +2415,7 @@ public async Task DeleteSqlStoredProcedureAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL storedProcedure. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3126,7 +2490,7 @@ internal HttpMessage CreateListSqlUserDefinedFunctionsRequest(string subscriptio } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3159,7 +2523,7 @@ public async Task> ListSqlUse } /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3238,7 +2602,7 @@ internal HttpMessage CreateGetSqlUserDefinedFunctionRequest(string subscriptionI } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3275,7 +2639,7 @@ public async Task> GetSqlUserDefine } /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3362,7 +2726,7 @@ internal HttpMessage CreateCreateUpdateSqlUserDefinedFunctionRequest(string subs } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3395,7 +2759,7 @@ public async Task CreateUpdateSqlUserDefinedFunctionAsync(string subsc } /// Create or update an Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3473,7 +2837,7 @@ internal HttpMessage CreateDeleteSqlUserDefinedFunctionRequest(string subscripti } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3504,7 +2868,7 @@ public async Task DeleteSqlUserDefinedFunctionAsync(string subscriptio } /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3579,7 +2943,7 @@ internal HttpMessage CreateListSqlTriggersRequest(string subscriptionId, string } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3612,7 +2976,7 @@ public async Task> ListSqlTriggersAsync(s } /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3691,7 +3055,7 @@ internal HttpMessage CreateGetSqlTriggerRequest(string subscriptionId, string re } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3728,7 +3092,7 @@ public async Task> GetSqlTriggerAsync(string su } /// Gets the SQL trigger under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3815,7 +3179,7 @@ internal HttpMessage CreateCreateUpdateSqlTriggerRequest(string subscriptionId, } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3848,7 +3212,7 @@ public async Task CreateUpdateSqlTriggerAsync(string subscriptionId, s } /// Create or update an Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3926,7 +3290,7 @@ internal HttpMessage CreateDeleteSqlTriggerRequest(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -3957,7 +3321,7 @@ public async Task DeleteSqlTriggerAsync(string subscriptionId, string } /// Deletes an existing Azure Cosmos DB SQL trigger. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4026,7 +3390,7 @@ internal HttpMessage CreateGetSqlRoleDefinitionRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4059,7 +3423,7 @@ public async Task> GetSqlRoleDefinitionA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4134,7 +3498,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleDefinitionRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4163,7 +3527,7 @@ public async Task CreateUpdateSqlRoleDefinitionAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4230,7 +3594,7 @@ internal HttpMessage CreateDeleteSqlRoleDefinitionRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4258,7 +3622,7 @@ public async Task DeleteSqlRoleDefinitionAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Definition. @@ -4322,7 +3686,7 @@ internal HttpMessage CreateListSqlRoleDefinitionsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4351,7 +3715,7 @@ public async Task> ListSqlRoleDefinition } /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4418,7 +3782,7 @@ internal HttpMessage CreateGetSqlRoleAssignmentRequest(string subscriptionId, st } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4451,7 +3815,7 @@ public async Task> GetSqlRoleAssignmentA } /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4526,7 +3890,7 @@ internal HttpMessage CreateCreateUpdateSqlRoleAssignmentRequest(string subscript } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4555,7 +3919,7 @@ public async Task CreateUpdateSqlRoleAssignmentAsync(string subscripti } /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4622,7 +3986,7 @@ internal HttpMessage CreateDeleteSqlRoleAssignmentRequest(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4650,7 +4014,7 @@ public async Task DeleteSqlRoleAssignmentAsync(string subscriptionId, } /// Deletes an existing Azure Cosmos DB SQL Role Assignment. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The GUID for the Role Assignment. @@ -4714,7 +4078,7 @@ internal HttpMessage CreateListSqlRoleAssignmentsRequest(string subscriptionId, } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4743,7 +4107,7 @@ public async Task> ListSqlRoleAssignment } /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -4820,7 +4184,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. @@ -4851,7 +4215,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a container resource. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB database name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs index 0397dbd21317..ba8ebce68b9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public TableResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; + _apiVersion = apiVersion ?? "2024-11-15"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListTablesRequest(string subscriptionId, string resou } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListTablesAsync(string subs } /// Lists the Tables under an existing Azure Cosmos DB database account. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetTableRequest(string subscriptionId, string resourc } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -202,7 +202,7 @@ public async Task> GetTableAsync(string subscription } /// Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateUpdateTableRequest(string subscriptionId, strin } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -306,7 +306,7 @@ public async Task CreateUpdateTableAsync(string subscriptionId, string } /// Create or update an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -372,7 +372,7 @@ internal HttpMessage CreateDeleteTableRequest(string subscriptionId, string reso } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -399,7 +399,7 @@ public async Task DeleteTableAsync(string subscriptionId, string resou } /// Deletes an existing Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -466,7 +466,7 @@ internal HttpMessage CreateGetTableThroughputRequest(string subscriptionId, stri } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -499,7 +499,7 @@ public async Task> GetTableThroughputAsync(strin } /// Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -576,7 +576,7 @@ internal HttpMessage CreateUpdateTableThroughputRequest(string subscriptionId, s } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -605,7 +605,7 @@ public async Task UpdateTableThroughputAsync(string subscriptionId, st } /// Update RUs per second of an Azure Cosmos DB Table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -674,7 +674,7 @@ internal HttpMessage CreateMigrateTableToAutoscaleRequest(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -701,7 +701,7 @@ public async Task MigrateTableToAutoscaleAsync(string subscriptionId, } /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -768,7 +768,7 @@ internal HttpMessage CreateMigrateTableToManualThroughputRequest(string subscrip } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -795,7 +795,7 @@ public async Task MigrateTableToManualThroughputAsync(string subscript } /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -866,7 +866,7 @@ internal HttpMessage CreateRetrieveContinuousBackupInformationRequest(string sub } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. @@ -895,7 +895,7 @@ public async Task RetrieveContinuousBackupInformationAsync(string subs } /// Retrieves continuous backup information for a table. - /// The ID of the target subscription. The value must be an UUID. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Cosmos DB database account name. /// Cosmos DB table name. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs deleted file mode 100644 index fa6087fb942a..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs +++ /dev/null @@ -1,334 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolAccountData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBThroughputPoolAccountData.DeserializeCosmosDBThroughputPoolAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, 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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The parameters to provide for the current ThroughputPoolAccount. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CosmosDBThroughputPoolAccountData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts/", false); - uri.AppendPath(throughputPoolAccountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Removes an existing Azure Cosmos DB database account from a throughput pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// Cosmos DB global database account in a Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, string throughputPoolAccountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNullOrEmpty(throughputPoolAccountName, nameof(throughputPoolAccountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName, throughputPoolAccountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs deleted file mode 100644 index 331d4a1aa715..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs +++ /dev/null @@ -1,217 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolAccountsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolAccountsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolAccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendPath("/throughputPoolAccounts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB accounts available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolAccountsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolAccountsListResult.DeserializeThroughputPoolAccountsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs deleted file mode 100644 index 1476c1c734c0..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs +++ /dev/null @@ -1,403 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CosmosDBThroughputPoolData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CosmosDBThroughputPoolData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, 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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current ThroughputPool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, 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(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The parameters to provide for the current Throughput Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string throughputPoolName, CosmosDBThroughputPoolPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, throughputPoolName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string throughputPoolName) - { - 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/throughputPools/", false); - uri.AppendPath(throughputPoolName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an existing Azure Cosmos DB Throughput Pool. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// Cosmos DB Throughput Pool name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string throughputPoolName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(throughputPoolName, nameof(throughputPoolName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, throughputPoolName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs deleted file mode 100644 index 936dc1ea04e3..000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs +++ /dev/null @@ -1,359 +0,0 @@ -// 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.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.CosmosDB.Models; - -namespace Azure.ResourceManager.CosmosDB -{ - internal partial class ThroughputPoolsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ThroughputPoolsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ThroughputPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.DocumentDB/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - 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/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - 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/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, 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/throughputPools", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the ThroughputPools in a given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ThroughputPoolsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ThroughputPoolsListResult.DeserializeThroughputPoolsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs index 0dba357a5560..8ebb481b87a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(Guid instanceId, /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -243,7 +243,7 @@ public virtual async Task> ExistsAsync(Guid instanceId, Cancellat /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual Response Exists(Guid instanceId, CancellationToken cancella /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs index 9837575f9dc1..be3c630f1c44 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs @@ -67,16 +67,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("creationTime"u8); writer.WriteStringValue(CreatedOn.Value, "O"); } - if (Optional.IsDefined(OldestRestorableOn)) - { - writer.WritePropertyName("oldestRestorableTime"u8); - writer.WriteStringValue(OldestRestorableOn.Value, "O"); - } if (Optional.IsDefined(DeletedOn)) { writer.WritePropertyName("deletionTime"u8); writer.WriteStringValue(DeletedOn.Value, "O"); } + if (Optional.IsDefined(OldestRestorableOn)) + { + writer.WritePropertyName("oldestRestorableTime"u8); + writer.WriteStringValue(OldestRestorableOn.Value, "O"); + } if (options.Format != "W" && Optional.IsDefined(ApiType)) { writer.WritePropertyName("apiType"u8); @@ -138,8 +138,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou SystemData systemData = default; string accountName = default; DateTimeOffset? creationTime = default; - DateTimeOffset? oldestRestorableTime = default; DateTimeOffset? deletionTime = default; + DateTimeOffset? oldestRestorableTime = default; CosmosDBApiType? apiType = default; IReadOnlyList restorableLocations = default; IDictionary serializedAdditionalRawData = default; @@ -202,22 +202,22 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou creationTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("oldestRestorableTime"u8)) + if (property0.NameEquals("deletionTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); + deletionTime = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("deletionTime"u8)) + if (property0.NameEquals("oldestRestorableTime"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - deletionTime = property0.Value.GetDateTimeOffset("O"); + oldestRestorableTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("apiType"u8)) @@ -260,8 +260,8 @@ internal static RestorableCosmosDBAccountData DeserializeRestorableCosmosDBAccou location, accountName, creationTime, - oldestRestorableTime, deletionTime, + oldestRestorableTime, apiType, restorableLocations ?? new ChangeTrackingList(), serializedAdditionalRawData); @@ -387,34 +387,34 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" oldestRestorableTime: "); + builder.Append(" deletionTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(OldestRestorableOn)) + if (Optional.IsDefined(DeletedOn)) { - builder.Append(" oldestRestorableTime: "); - var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); + builder.Append(" deletionTime: "); + var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldestRestorableOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" deletionTime: "); + builder.Append(" oldestRestorableTime: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(DeletedOn)) + if (Optional.IsDefined(OldestRestorableOn)) { - builder.Append(" deletionTime: "); - var formattedDateTimeString = TypeFormatters.ToString(DeletedOn.Value, "o"); + builder.Append(" oldestRestorableTime: "); + var formattedDateTimeString = TypeFormatters.ToString(OldestRestorableOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs index 297199d694ad..e0792a9e8cbb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.cs @@ -65,18 +65,18 @@ internal RestorableCosmosDBAccountData() /// The location of the resource group to which the resource belongs. /// The name of the global database account. /// The creation time of the restorable database account (ISO-8601 format). - /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The time at which the restorable database account has been deleted (ISO-8601 format). + /// The least recent time at which the database account can be restored to (ISO-8601 format). /// The API type of the restorable database account. /// List of regions where the of the database account can be restored from. /// Keeps track of any properties unknown to the library. - internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? oldestRestorableOn, DateTimeOffset? deletedOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string accountName, DateTimeOffset? createdOn, DateTimeOffset? deletedOn, DateTimeOffset? oldestRestorableOn, CosmosDBApiType? apiType, IReadOnlyList restorableLocations, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; AccountName = accountName; CreatedOn = createdOn; - OldestRestorableOn = oldestRestorableOn; DeletedOn = deletedOn; + OldestRestorableOn = oldestRestorableOn; ApiType = apiType; RestorableLocations = restorableLocations; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -91,12 +91,12 @@ internal RestorableCosmosDBAccountData(ResourceIdentifier id, string name, Resou /// The creation time of the restorable database account (ISO-8601 format). [WirePath("properties.creationTime")] public DateTimeOffset? CreatedOn { get; } - /// The least recent time at which the database account can be restored to (ISO-8601 format). - [WirePath("properties.oldestRestorableTime")] - public DateTimeOffset? OldestRestorableOn { get; } /// The time at which the restorable database account has been deleted (ISO-8601 format). [WirePath("properties.deletionTime")] public DateTimeOffset? DeletedOn { get; } + /// The least recent time at which the database account can be restored to (ISO-8601 format). + [WirePath("properties.oldestRestorableTime")] + public DateTimeOffset? OldestRestorableOn { get; } /// The API type of the restorable database account. [WirePath("properties.apiType")] public CosmosDBApiType? ApiType { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs index d91379d270b3..ce22235cdae2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs @@ -146,7 +146,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -251,7 +251,7 @@ public virtual AsyncPageable GetRestorableSqlDatabasesAsy /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -276,7 +276,7 @@ public virtual Pageable GetRestorableSqlDatabases(Cancell /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -304,7 +304,7 @@ public virtual AsyncPageable GetRestorableSqlContainersA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -332,7 +332,7 @@ public virtual Pageable GetRestorableSqlContainers(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -359,7 +359,7 @@ public virtual AsyncPageable GetAllRestorableSqlResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -386,7 +386,7 @@ public virtual Pageable GetAllRestorableSqlResourceDa /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -411,7 +411,7 @@ public virtual AsyncPageable GetRestorableMongoDBData /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -436,7 +436,7 @@ public virtual Pageable GetRestorableMongoDBDatabases /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -464,7 +464,7 @@ public virtual AsyncPageable GetRestorableMongoDBCo /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -492,7 +492,7 @@ public virtual Pageable GetRestorableMongoDBCollect /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -519,7 +519,7 @@ public virtual AsyncPageable GetAllRestorableMong /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -546,7 +546,7 @@ public virtual Pageable GetAllRestorableMongoDBRe /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -571,7 +571,7 @@ public virtual AsyncPageable GetRestorableGremlinData /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -596,7 +596,7 @@ public virtual Pageable GetRestorableGremlinDatabases /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -624,7 +624,7 @@ public virtual AsyncPageable GetRestorableGremlinGraphsA /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -652,7 +652,7 @@ public virtual Pageable GetRestorableGremlinGraphs(strin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -679,7 +679,7 @@ public virtual AsyncPageable GetRestorableGremlin /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -706,7 +706,7 @@ public virtual Pageable GetRestorableGremlinResou /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -733,7 +733,7 @@ public virtual AsyncPageable GetRestorableTablesAsync(string st /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -760,7 +760,7 @@ public virtual Pageable GetRestorableTables(string startTime = /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// @@ -787,7 +787,7 @@ public virtual AsyncPageable GetRestorableTableReso /// /// /// Default Api Version - /// 2024-05-15-preview + /// 2024-11-15 /// /// /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs index 21b4a4133bd8..90d85f240306 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs @@ -30,12 +30,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - JsonSerializer.Serialize(writer, Identity, serializeOptions); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -115,7 +109,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -127,16 +120,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; - identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -215,7 +198,6 @@ internal static ThroughputSettingData DeserializeThroughputSettingData(JsonEleme tags ?? new ChangeTrackingDictionary(), location, resource, - identity, serializedAdditionalRawData); } @@ -302,21 +284,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" identity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Identity)) - { - builder.Append(" identity: "); - BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs index f2525edc1e55..4646f03bcf37 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.cs @@ -65,12 +65,10 @@ public ThroughputSettingData(AzureLocation location) : base(location) /// The tags. /// The location. /// - /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ThroughputSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedThroughputSettingsResourceInfo resource, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resource = resource; - Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,8 +80,5 @@ internal ThroughputSettingData() /// Gets or sets the resource. [WirePath("properties.resource")] public ExtendedThroughputSettingsResourceInfo Resource { get; set; } - /// Identity for the resource. - [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 34c76f1254ca..1dc82703f8db 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -9,7 +9,7 @@ azure-arm: true csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB -require: https://github.com/Azure/azure-rest-api-specs/blob/86b70ce378f0005c26b58ba0bcf96907bfa3a966/specification/cosmos-db/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md #tag: package-preview-2024-05 output-folder: $(this-folder)/Generated clear-output-folder: true