diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointCollection.cs new file mode 100644 index 000000000000..51dec53bf850 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointCollection.cs @@ -0,0 +1,172 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_ClusterRecoveryPointCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsARecoveryPoint() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ClusterRecoveryPoint_Get.json + // this example is just showing the usage of "ClusterRecoveryPoint_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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this ClusterRecoveryPointResource + ClusterRecoveryPointCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetClusterRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "06b9ae7f-f21d-4a76-9897-5cf5d6004d80"; + ClusterRecoveryPointResource result = await collection.GetAsync(recoveryPointName); + + // 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 + ClusterRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GetsTheListOfClusterRecoveryPoints() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ClusterRecoveryPoints_ListByReplicationProtectionCluster.json + // this example is just showing the usage of "ClusterRecoveryPoints_ListByReplicationProtectionCluster" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this ClusterRecoveryPointResource + ClusterRecoveryPointCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetClusterRecoveryPoints(); + + // invoke the operation and iterate over the result + await foreach (ClusterRecoveryPointResource 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 + ClusterRecoveryPointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsARecoveryPoint() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ClusterRecoveryPoint_Get.json + // this example is just showing the usage of "ClusterRecoveryPoint_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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this ClusterRecoveryPointResource + ClusterRecoveryPointCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetClusterRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "06b9ae7f-f21d-4a76-9897-5cf5d6004d80"; + bool result = await collection.ExistsAsync(recoveryPointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsARecoveryPoint() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ClusterRecoveryPoint_Get.json + // this example is just showing the usage of "ClusterRecoveryPoint_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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this ClusterRecoveryPointResource + ClusterRecoveryPointCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetClusterRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "06b9ae7f-f21d-4a76-9897-5cf5d6004d80"; + NullableResponse response = await collection.GetIfExistsAsync(recoveryPointName); + ClusterRecoveryPointResource 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 + ClusterRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointResource.cs new file mode 100644 index 000000000000..55d0d5171698 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ClusterRecoveryPointResource.cs @@ -0,0 +1,52 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_ClusterRecoveryPointResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsARecoveryPoint() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ClusterRecoveryPoint_Get.json + // this example is just showing the usage of "ClusterRecoveryPoint_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 ClusterRecoveryPointResource created on azure + // for more information of creating ClusterRecoveryPointResource, please refer to the document of ClusterRecoveryPointResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + string recoveryPointName = "06b9ae7f-f21d-4a76-9897-5cf5d6004d80"; + ResourceIdentifier clusterRecoveryPointResourceId = ClusterRecoveryPointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, recoveryPointName); + ClusterRecoveryPointResource clusterRecoveryPoint = client.GetClusterRecoveryPointResource(clusterRecoveryPointResourceId); + + // invoke the operation + ClusterRecoveryPointResource result = await clusterRecoveryPoint.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 + ClusterRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointCollection.cs index 15a6f8943556..3b0c325b1195 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_MigrationRecoveryPointCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsARecoveryPointForAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/MigrationRecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/MigrationRecoveryPoints_Get.json // this example is just showing the usage of "MigrationRecoveryPoints_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_GetsARecoveryPointForAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheRecoveryPointsForAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/MigrationRecoveryPoints_ListByReplicationMigrationItems.json // this example is just showing the usage of "MigrationRecoveryPoints_ListByReplicationMigrationItems" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +95,7 @@ public async Task GetAll_GetsTheRecoveryPointsForAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsARecoveryPointForAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/MigrationRecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/MigrationRecoveryPoints_Get.json // this example is just showing the usage of "MigrationRecoveryPoints_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 Exists_GetsARecoveryPointForAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsARecoveryPointForAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/MigrationRecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/MigrationRecoveryPoints_Get.json // this example is just showing the usage of "MigrationRecoveryPoints_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointResource.cs index 45c593b676d2..810b60c7ec79 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_MigrationRecoveryPointResource.cs @@ -19,7 +19,7 @@ public partial class Sample_MigrationRecoveryPointResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsARecoveryPointForAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/MigrationRecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/MigrationRecoveryPoints_Get.json // this example is just showing the usage of "MigrationRecoveryPoints_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingCollection.cs index 946e7223a407..b573a13b4505 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ProtectionContainerMappingCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsAProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Get.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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 @@ -55,7 +55,7 @@ public async Task Get_GetsAProtectionContainerMapping() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfProtectionContainerMappingsForAProtectionContainer() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_ListByReplicationProtectionContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfProtectionContainerMappingsForAProtectionC [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Get.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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 @@ -125,7 +125,7 @@ public async Task Exists_GetsAProtectionContainerMapping() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Get.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingResource.cs index 1506a350acd5..8b9936f33d90 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ProtectionContainerMappingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ProtectionContainerMappingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Get.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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_GetsAProtectionContainerMapping() [Ignore("Only validating compilation of examples")] public async Task Delete_PurgeProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Purge.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Purge.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_Purge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_PurgeProtectionContainerMapping() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Update.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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 @@ -124,7 +124,7 @@ public async Task Update_UpdateProtectionContainerMapping() [Ignore("Only validating compilation of examples")] public async Task Delete_RemoveProtectionContainerMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_Delete.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultCollection.cs index e3a585b1305f..a6194be439c5 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ReplicationEligibilityResultCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEligibilityResults_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEligibilityResults_Get.json // this example is just showing the usage of "ReplicationEligibilityResults_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_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtectio [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEligibilityResults_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEligibilityResults_List.json // this example is just showing the usage of "ReplicationEligibilityResults_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 @@ -89,7 +89,7 @@ public async Task GetAll_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtec [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEligibilityResults_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEligibilityResults_Get.json // this example is just showing the usage of "ReplicationEligibilityResults_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 @@ -118,7 +118,7 @@ public async Task Exists_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtec [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEligibilityResults_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEligibilityResults_Get.json // this example is just showing the usage of "ReplicationEligibilityResults_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultResource.cs index d72b9c3bcd1e..318188e8ac0e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationEligibilityResultResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ReplicationEligibilityResultResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheValidationErrorsInCaseTheVMIsUnsuitableForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEligibilityResults_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEligibilityResults_Get.json // this example is just showing the usage of "ReplicationEligibilityResults_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemCollection.cs index a87f31eee735..174d8af1271f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ReplicationProtectedItemCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_EnablesProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Create.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_EnablesProtection() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Get.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -102,7 +102,7 @@ public async Task Get_GetsTheDetailsOfAReplicationProtectedItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfReplicationProtectedItems() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_ListByReplicationProtectionContainers.json // this example is just showing the usage of "ReplicationProtectedItems_ListByReplicationProtectionContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +140,7 @@ public async Task GetAll_GetsTheListOfReplicationProtectedItems() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Get.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -172,7 +172,7 @@ public async Task Exists_GetsTheDetailsOfAReplicationProtectedItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Get.json // this example is just showing the usage of "ReplicationProtectedItems_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemResource.cs index 79d0cc0546ae..f75d822f72e4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectedItemResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ReplicationProtectedItemResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Get.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -54,7 +54,7 @@ public async Task Get_GetsTheDetailsOfAReplicationProtectedItem() [Ignore("Only validating compilation of examples")] public async Task Delete_PurgesProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Purge.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Purge.json // this example is just showing the usage of "ReplicationProtectedItems_Purge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_PurgesProtection() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesTheReplicationProtectedItemSettings() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Update.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -140,7 +140,7 @@ public async Task Update_UpdatesTheReplicationProtectedItemSettings() [Ignore("Only validating compilation of examples")] public async Task AddDisks_AddDiskSForProtection() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_AddDisks.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_AddDisks.json // this example is just showing the usage of "ReplicationProtectedItems_AddDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 AddDisks_AddDiskSForProtection() [Ignore("Only validating compilation of examples")] public async Task ApplyRecoveryPoint_ChangeOrApplyRecoveryPoint() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_ApplyRecoveryPoint.json // this example is just showing the usage of "ReplicationProtectedItems_ApplyRecoveryPoint" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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,7 +219,7 @@ public async Task ApplyRecoveryPoint_ChangeOrApplyRecoveryPoint() [Ignore("Only validating compilation of examples")] public async Task FailoverCancel_ExecuteCancelFailover() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_FailoverCancel.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_FailoverCancel.json // this example is just showing the usage of "ReplicationProtectedItems_FailoverCancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -253,7 +253,7 @@ public async Task FailoverCancel_ExecuteCancelFailover() [Ignore("Only validating compilation of examples")] public async Task FailoverCommit_ExecuteCommitFailover() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_FailoverCommit.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_FailoverCommit.json // this example is just showing the usage of "ReplicationProtectedItems_FailoverCommit" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +287,7 @@ public async Task FailoverCommit_ExecuteCommitFailover() [Ignore("Only validating compilation of examples")] public async Task PlannedFailover_ExecutePlannedFailover() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_PlannedFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_PlannedFailover.json // this example is just showing the usage of "ReplicationProtectedItems_PlannedFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -329,7 +329,7 @@ public async Task PlannedFailover_ExecutePlannedFailover() [Ignore("Only validating compilation of examples")] public async Task RemoveDisks_RemovesDiskS() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_RemoveDisks.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_RemoveDisks.json // this example is just showing the usage of "ReplicationProtectedItems_RemoveDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -370,7 +370,7 @@ public async Task RemoveDisks_RemovesDiskS() [Ignore("Only validating compilation of examples")] public async Task RepairReplication_ResynchronizeOrRepairReplication() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_RepairReplication.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_RepairReplication.json // this example is just showing the usage of "ReplicationProtectedItems_RepairReplication" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -404,7 +404,7 @@ public async Task RepairReplication_ResynchronizeOrRepairReplication() [Ignore("Only validating compilation of examples")] public async Task Reprotect_ExecuteReverseReplicationReprotect() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_Reprotect.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_Reprotect.json // this example is just showing the usage of "ReplicationProtectedItems_Reprotect" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -446,7 +446,7 @@ public async Task Reprotect_ExecuteReverseReplicationReprotect() [Ignore("Only validating compilation of examples")] public async Task ResolveHealthErrors_ResolveHealthErrors() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_ResolveHealthErrors.json // this example is just showing the usage of "ReplicationProtectedItems_ResolveHealthErrors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 ResolveHealthErrors_ResolveHealthErrors() [Ignore("Only validating compilation of examples")] public async Task SwitchProvider_ExecuteSwitchProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_SwitchProvider.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_SwitchProvider.json // this example is just showing the usage of "ReplicationProtectedItems_SwitchProvider" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +529,7 @@ public async Task SwitchProvider_ExecuteSwitchProvider() [Ignore("Only validating compilation of examples")] public async Task TestFailover_ExecuteTestFailover() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_TestFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_TestFailover.json // this example is just showing the usage of "ReplicationProtectedItems_TestFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -570,7 +570,7 @@ public async Task TestFailover_ExecuteTestFailover() [Ignore("Only validating compilation of examples")] public async Task TestFailoverCleanup_ExecuteTestFailoverCleanup() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_TestFailoverCleanup.json // this example is just showing the usage of "ReplicationProtectedItems_TestFailoverCleanup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -608,7 +608,7 @@ public async Task TestFailoverCleanup_ExecuteTestFailoverCleanup() [Ignore("Only validating compilation of examples")] public async Task UnplannedFailover_ExecuteUnplannedFailover() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_UnplannedFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_UnplannedFailover.json // this example is just showing the usage of "ReplicationProtectedItems_UnplannedFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -648,7 +648,7 @@ public async Task UnplannedFailover_ExecuteUnplannedFailover() [Ignore("Only validating compilation of examples")] public async Task UpdateAppliance_UpdatesApplianceForReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_UpdateAppliance.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_UpdateAppliance.json // this example is just showing the usage of "ReplicationProtectedItems_UpdateAppliance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -686,7 +686,7 @@ public async Task UpdateAppliance_UpdatesApplianceForReplicationProtectedItem() [Ignore("Only validating compilation of examples")] public async Task UpdateMobilityService_UpdateTheMobilityServiceOnAProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_UpdateMobilityService.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_UpdateMobilityService.json // this example is just showing the usage of "ReplicationProtectedItems_UpdateMobilityService" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +724,7 @@ public async Task UpdateMobilityService_UpdateTheMobilityServiceOnAProtectedItem [Ignore("Only validating compilation of examples")] public async Task GetTargetComputeSizesByReplicationProtectedItems_GetsTheListOfTargetComputeSizesForTheReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TargetComputeSizes_ListByReplicationProtectedItems.json // this example is just showing the usage of "TargetComputeSizes_ListByReplicationProtectedItems" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentCollection.cs index 44122877793f..ed5b237637ad 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ReplicationProtectionIntentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateProtectionIntentResource() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Create.json // this example is just showing the usage of "ReplicationProtectionIntents_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 @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CreateProtectionIntentResource() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAReplicationProtectionIntentItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Get.json // this example is just showing the usage of "ReplicationProtectionIntents_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 @@ -100,7 +100,7 @@ public async Task Get_GetsTheDetailsOfAReplicationProtectionIntentItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfReplicationProtectionIntentObjects() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_List.json // this example is just showing the usage of "ReplicationProtectionIntents_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 @@ -136,7 +136,7 @@ public async Task GetAll_GetsTheListOfReplicationProtectionIntentObjects() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAReplicationProtectionIntentItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Get.json // this example is just showing the usage of "ReplicationProtectionIntents_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 Exists_GetsTheDetailsOfAReplicationProtectionIntentItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAReplicationProtectionIntentItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Get.json // this example is just showing the usage of "ReplicationProtectionIntents_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentResource.cs index 01cb73c630d6..976a52277cec 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ReplicationProtectionIntentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ReplicationProtectionIntentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAReplicationProtectionIntentItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Get.json // this example is just showing the usage of "ReplicationProtectionIntents_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheDetailsOfAReplicationProtectionIntentItem() [Ignore("Only validating compilation of examples")] public async Task Update_CreateProtectionIntentResource() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionIntents_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionIntents_Create.json // this example is just showing the usage of "ReplicationProtectionIntents_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 diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs index a3a1d55c16b0..15d658100f2a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_ResourceGroupResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetReplicationAppliances_GetsTheListOfAppliances() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAppliances_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAppliances_List.json // this example is just showing the usage of "ReplicationAppliances_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 @@ -50,7 +50,7 @@ public async Task GetReplicationAppliances_GetsTheListOfAppliances() [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryNetworks_GetsTheListOfNetworksViewOnlyAPI() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_List.json // this example is just showing the usage of "ReplicationNetworks_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 @@ -83,7 +83,7 @@ public async Task GetSiteRecoveryNetworks_GetsTheListOfNetworksViewOnlyAPI() [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryNetworkMappings_GetsAllTheNetworkMappingsUnderAVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_List.json // this example is just showing the usage of "ReplicationNetworkMappings_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 @@ -116,7 +116,7 @@ public async Task GetSiteRecoveryNetworkMappings_GetsAllTheNetworkMappingsUnderA [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryProtectionContainers_GetsTheListOfAllProtectionContainersInAVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_List.json // this example is just showing the usage of "ReplicationProtectionContainers_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 @@ -149,7 +149,7 @@ public async Task GetSiteRecoveryProtectionContainers_GetsTheListOfAllProtection [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryMigrationItems_GetsTheListOfMigrationItemsInTheVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_List.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -182,7 +182,7 @@ public async Task GetSiteRecoveryMigrationItems_GetsTheListOfMigrationItemsInThe [Ignore("Only validating compilation of examples")] public async Task GetReplicationProtectedItems_GetsTheListOfReplicationProtectedItems() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectedItems_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectedItems_List.json // this example is just showing the usage of "ReplicationProtectedItems_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 @@ -211,11 +211,42 @@ public async Task GetReplicationProtectedItems_GetsTheListOfReplicationProtected Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetReplicationProtectionClusters_GetsTheListOfReplicationProtectionClustersInVault() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_List.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation and iterate over the result + string resourceName = "vault1"; + string filter = "SourceFabricName eq 'asr-a2a-default-eastus' and SourceFabricLocation eq 'East US' and InstanceType eq 'A2A'"; + await foreach (ReplicationProtectionClusterData item in resourceGroupResource.GetReplicationProtectionClustersAsync(resourceName, filter: filter)) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetProtectionContainerMappings_GetsTheListOfAllProtectionContainerMappingsInAVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainerMappings_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainerMappings_List.json // this example is just showing the usage of "ReplicationProtectionContainerMappings_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 @@ -248,7 +279,7 @@ public async Task GetProtectionContainerMappings_GetsTheListOfAllProtectionConta [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryServicesProviders_GetsTheListOfRegisteredRecoveryServicesProvidersInTheVaultThisIsAViewOnlyApi() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_List.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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 @@ -281,7 +312,7 @@ public async Task GetSiteRecoveryServicesProviders_GetsTheListOfRegisteredRecove [Ignore("Only validating compilation of examples")] public async Task GetStorageClassifications_GetsTheListOfStorageClassificationObjectsUnderAVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_List.json // this example is just showing the usage of "ReplicationStorageClassifications_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 @@ -314,7 +345,7 @@ public async Task GetStorageClassifications_GetsTheListOfStorageClassificationOb [Ignore("Only validating compilation of examples")] public async Task GetStorageClassificationMappings_GetsTheListOfStorageClassificationMappingsObjectsUnderAVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_List.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 @@ -347,7 +378,7 @@ public async Task GetStorageClassificationMappings_GetsTheListOfStorageClassific [Ignore("Only validating compilation of examples")] public async Task GetSiteRecoveryVCenters_GetsTheListOfVCenterRegisteredUnderTheVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_List.json // this example is just showing the usage of "ReplicationvCenters_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 @@ -380,7 +411,7 @@ public async Task GetSiteRecoveryVCenters_GetsTheListOfVCenterRegisteredUnderThe [Ignore("Only validating compilation of examples")] public async Task GetSupportedOperatingSystem_GetsTheDataOfSupportedOperatingSystemsBySRS() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/SupportedOperatingSystems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/SupportedOperatingSystems_Get.json // this example is just showing the usage of "SupportedOperatingSystems_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 @@ -406,7 +437,7 @@ public async Task GetSupportedOperatingSystem_GetsTheDataOfSupportedOperatingSys [Ignore("Only validating compilation of examples")] public async Task GetReplicationVaultHealth_GetsTheHealthSummaryForTheVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultHealth_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultHealth_Get.json // this example is just showing the usage of "ReplicationVaultHealth_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 @@ -432,7 +463,7 @@ public async Task GetReplicationVaultHealth_GetsTheHealthSummaryForTheVault() [Ignore("Only validating compilation of examples")] public async Task RefreshReplicationVaultHealth_RefreshesHealthSummaryOfTheVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultHealth_Refresh.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultHealth_Refresh.json // this example is just showing the usage of "ReplicationVaultHealth_Refresh" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertCollection.cs index 46f7c67ffb72..fec19de6f19d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryAlertCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ConfiguresEmailNotificationsForThisVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Create.json // this example is just showing the usage of "ReplicationAlertSettings_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 @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_ConfiguresEmailNotificationsForThisVault() [Ignore("Only validating compilation of examples")] public async Task Get_GetsAnEmailNotificationAlertConfiguration() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Get.json // this example is just showing the usage of "ReplicationAlertSettings_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 @@ -99,7 +99,7 @@ public async Task Get_GetsAnEmailNotificationAlertConfiguration() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfConfiguredEmailNotificationAlertConfigurations() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_List.json // this example is just showing the usage of "ReplicationAlertSettings_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 @@ -135,7 +135,7 @@ public async Task GetAll_GetsTheListOfConfiguredEmailNotificationAlertConfigurat [Ignore("Only validating compilation of examples")] public async Task Exists_GetsAnEmailNotificationAlertConfiguration() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Get.json // this example is just showing the usage of "ReplicationAlertSettings_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 @@ -165,7 +165,7 @@ public async Task Exists_GetsAnEmailNotificationAlertConfiguration() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsAnEmailNotificationAlertConfiguration() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Get.json // this example is just showing the usage of "ReplicationAlertSettings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertResource.cs index e62551456ecd..1f61d1f2a07e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryAlertResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryAlertResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsAnEmailNotificationAlertConfiguration() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Get.json // this example is just showing the usage of "ReplicationAlertSettings_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 @@ -51,7 +51,7 @@ public async Task Get_GetsAnEmailNotificationAlertConfiguration() [Ignore("Only validating compilation of examples")] public async Task Update_ConfiguresEmailNotificationsForThisVault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationAlertSettings_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationAlertSettings_Create.json // this example is just showing the usage of "ReplicationAlertSettings_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 diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventCollection.cs index 6f7c8ce6f06e..061ecb856c43 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryEventCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetTheDetailsOfAnAzureSiteRecoveryEvent() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEvents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEvents_Get.json // this example is just showing the usage of "ReplicationEvents_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 @@ -54,7 +54,7 @@ public async Task Get_GetTheDetailsOfAnAzureSiteRecoveryEvent() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfAzureSiteRecoveryEvents() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEvents_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEvents_List.json // this example is just showing the usage of "ReplicationEvents_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 @@ -90,7 +90,7 @@ public async Task GetAll_GetsTheListOfAzureSiteRecoveryEvents() [Ignore("Only validating compilation of examples")] public async Task Exists_GetTheDetailsOfAnAzureSiteRecoveryEvent() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEvents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEvents_Get.json // this example is just showing the usage of "ReplicationEvents_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 @@ -120,7 +120,7 @@ public async Task Exists_GetTheDetailsOfAnAzureSiteRecoveryEvent() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetTheDetailsOfAnAzureSiteRecoveryEvent() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEvents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEvents_Get.json // this example is just showing the usage of "ReplicationEvents_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventResource.cs index 4b982754886d..8b5524f68ae1 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryEventResource.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryEventResource [Ignore("Only validating compilation of examples")] public async Task Get_GetTheDetailsOfAnAzureSiteRecoveryEvent() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationEvents_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationEvents_Get.json // this example is just showing the usage of "ReplicationEvents_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricCollection.cs index 264c61b40a4c..a4157ca0a3da 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryFabricCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAnASRFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_Get.json // this example is just showing the usage of "ReplicationFabrics_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 @@ -54,7 +54,7 @@ public async Task Get_GetsTheDetailsOfAnASRFabric() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfASRFabrics() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_List.json // this example is just showing the usage of "ReplicationFabrics_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 @@ -90,7 +90,7 @@ public async Task GetAll_GetsTheListOfASRFabrics() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAnASRFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_Get.json // this example is just showing the usage of "ReplicationFabrics_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 @@ -120,7 +120,7 @@ public async Task Exists_GetsTheDetailsOfAnASRFabric() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAnASRFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_Get.json // this example is just showing the usage of "ReplicationFabrics_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricResource.cs index cc20e5524090..5a65cddd9b40 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryFabricResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryFabricResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAnASRFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_Get.json // this example is just showing the usage of "ReplicationFabrics_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheDetailsOfAnASRFabric() [Ignore("Only validating compilation of examples")] public async Task CheckConsistency_ChecksTheConsistencyOfTheASRFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_CheckConsistency.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_CheckConsistency.json // this example is just showing the usage of "ReplicationFabrics_CheckConsistency" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task CheckConsistency_ChecksTheConsistencyOfTheASRFabric() [Ignore("Only validating compilation of examples")] public async Task MigrateToAad_MigratesTheSiteToAAD() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_MigrateToAad.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_MigrateToAad.json // this example is just showing the usage of "ReplicationFabrics_MigrateToAad" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +110,7 @@ public async Task MigrateToAad_MigratesTheSiteToAAD() [Ignore("Only validating compilation of examples")] public async Task ReassociateGateway_PerformFailoverOfTheProcessServer() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_ReassociateGateway.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_ReassociateGateway.json // this example is just showing the usage of "ReplicationFabrics_ReassociateGateway" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -153,7 +153,7 @@ public async Task ReassociateGateway_PerformFailoverOfTheProcessServer() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesTheSite() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_Delete.json // this example is just showing the usage of "ReplicationFabrics_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 @@ -180,7 +180,7 @@ public async Task Delete_DeletesTheSite() [Ignore("Only validating compilation of examples")] public async Task RenewCertificate_RenewsCertificateForTheFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationFabrics_RenewCertificate.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationFabrics_RenewCertificate.json // this example is just showing the usage of "ReplicationFabrics_RenewCertificate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -216,7 +216,7 @@ public async Task RenewCertificate_RenewsCertificateForTheFabric() [Ignore("Only validating compilation of examples")] public async Task RemoveInfra_RemovesTheApplianceSInfrastructureUnderTheFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationInfrastructure_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationInfrastructure_Delete.json // this example is just showing the usage of "ReplicationFabrics_RemoveInfra" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobCollection.cs index 83cae466b8c0..d27454950f15 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryJobCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheJobDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Get.json // this example is just showing the usage of "ReplicationJobs_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 @@ -54,7 +54,7 @@ public async Task Get_GetsTheJobDetails() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfJobs() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_List.json // this example is just showing the usage of "ReplicationJobs_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 @@ -90,7 +90,7 @@ public async Task GetAll_GetsTheListOfJobs() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheJobDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Get.json // this example is just showing the usage of "ReplicationJobs_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 @@ -120,7 +120,7 @@ public async Task Exists_GetsTheJobDetails() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheJobDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Get.json // this example is just showing the usage of "ReplicationJobs_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobResource.cs index 1f9684776e97..fdbe79208340 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryJobResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryJobResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheJobDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Get.json // this example is just showing the usage of "ReplicationJobs_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheJobDetails() [Ignore("Only validating compilation of examples")] public async Task Cancel_CancelsTheSpecifiedJob() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Cancel.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Cancel.json // this example is just showing the usage of "ReplicationJobs_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 @@ -83,7 +83,7 @@ public async Task Cancel_CancelsTheSpecifiedJob() [Ignore("Only validating compilation of examples")] public async Task Restart_RestartsTheSpecifiedJob() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Restart.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Restart.json // this example is just showing the usage of "ReplicationJobs_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Restart_RestartsTheSpecifiedJob() [Ignore("Only validating compilation of examples")] public async Task Resume_ResumesTheSpecifiedJob() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationJobs_Resume.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationJobs_Resume.json // this example is just showing the usage of "ReplicationJobs_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 diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkCollection.cs index 38884b66192c..1f112df79862 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryLogicalNetworkCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationLogicalNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationLogicalNetworks_Get.json // this example is just showing the usage of "ReplicationLogicalNetworks_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 @@ -54,7 +54,7 @@ public async Task Get_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkN [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfLogicalNetworksUnderAFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationLogicalNetworks_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationLogicalNetworks_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfLogicalNetworksUnderAFabric() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationLogicalNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationLogicalNetworks_Get.json // this example is just showing the usage of "ReplicationLogicalNetworks_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_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetwo [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationLogicalNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationLogicalNetworks_Get.json // this example is just showing the usage of "ReplicationLogicalNetworks_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkResource.cs index 57f0b077c94f..9404aa8da734 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryLogicalNetworkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryLogicalNetworkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsALogicalNetworkWithSpecifiedServerIdAndLogicalNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationLogicalNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationLogicalNetworks_Get.json // this example is just showing the usage of "ReplicationLogicalNetworks_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemCollection.cs index 058fd0a23777..a73eeadb9c7f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryMigrationItemCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_EnablesMigration() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Create.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -48,6 +48,11 @@ public async Task CreateOrUpdate_EnablesMigration() new VMwareCbtDiskContent[] { new VMwareCbtDiskContent("disk1", "true", new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Storage/storageAccounts/logStorageAccount1"), "logStorageSas") +{ +Iops = 3000L, +ThroughputInMbps = 5000L, +DiskSizeInGB = 60L, +} }, new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/dataMoverRunAsAccount1"), new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.OffAzure/VMwareSites/vmwaresite1/runasaccounts/snapshotRunAsAccount1"), @@ -67,7 +72,7 @@ public async Task CreateOrUpdate_EnablesMigration() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Get.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -103,7 +108,7 @@ public async Task Get_GetsTheDetailsOfAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfMigrationItemsInTheProtectionContainer() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_ListByReplicationProtectionContainers.json // this example is just showing the usage of "ReplicationMigrationItems_ListByReplicationProtectionContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +146,7 @@ public async Task GetAll_GetsTheListOfMigrationItemsInTheProtectionContainer() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Get.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -173,7 +178,7 @@ public async Task Exists_GetsTheDetailsOfAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Get.json // this example is just showing the usage of "ReplicationMigrationItems_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemResource.cs index c25117eeb604..147defb2b03d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryMigrationItemResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryMigrationItemResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Get.json // this example is just showing the usage of "ReplicationMigrationItems_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_GetsTheDetailsOfAMigrationItem() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteTheMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Delete.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -82,7 +82,7 @@ public async Task Delete_DeleteTheMigrationItem() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesMigrationItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Update.json // this example is just showing the usage of "ReplicationMigrationItems_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 @@ -120,7 +120,7 @@ public async Task Update_UpdatesMigrationItem() [Ignore("Only validating compilation of examples")] public async Task Migrate_MigrateItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Migrate.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Migrate.json // this example is just showing the usage of "ReplicationMigrationItems_Migrate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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,7 +155,7 @@ public async Task Migrate_MigrateItem() [Ignore("Only validating compilation of examples")] public async Task PauseReplication_PauseReplication() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_PauseReplication.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_PauseReplication.json // this example is just showing the usage of "ReplicationMigrationItems_PauseReplication" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -190,7 +190,7 @@ public async Task PauseReplication_PauseReplication() [Ignore("Only validating compilation of examples")] public async Task ResumeReplication_ResumeReplication() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_ResumeReplication.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_ResumeReplication.json // this example is just showing the usage of "ReplicationMigrationItems_ResumeReplication" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,7 +228,7 @@ public async Task ResumeReplication_ResumeReplication() [Ignore("Only validating compilation of examples")] public async Task Resync_ResynchronizesReplication() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_Resync.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_Resync.json // this example is just showing the usage of "ReplicationMigrationItems_Resync" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -263,7 +263,7 @@ public async Task Resync_ResynchronizesReplication() [Ignore("Only validating compilation of examples")] public async Task TestMigrate_TestMigrateItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_TestMigrate.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_TestMigrate.json // this example is just showing the usage of "ReplicationMigrationItems_TestMigrate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,10 @@ public async Task TestMigrate_TestMigrateItem() SiteRecoveryMigrationItemResource siteRecoveryMigrationItem = client.GetSiteRecoveryMigrationItemResource(siteRecoveryMigrationItemResourceId); // invoke the operation - TestMigrateContent content = new TestMigrateContent(new TestMigrateProperties(new VMwareCbtTestMigrateContent(new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686"), new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1")))); + TestMigrateContent content = new TestMigrateContent(new TestMigrateProperties(new VMwareCbtTestMigrateContent(new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.RecoveryServices/vaults/migrationvault/replicationFabrics/vmwarefabric1/replicationProtectionContainers/vmwareContainer1/replicationMigrationItems/virtualmachine1/migrationRecoveryPoints/9e737191-317e-43d0-8c83-e32ac3b34686"), new ResourceIdentifier("/Subscriptions/cb53d0c3-bd59-4721-89bc-06916a9147ef/resourceGroups/resourcegroup1/providers/Microsoft.Network/virtualNetworks/virtualNetwork1")) + { + OSUpgradeVersion = "Microsoft Windows Server 2019 (64-bit)", + })); ArmOperation lro = await siteRecoveryMigrationItem.TestMigrateAsync(WaitUntil.Completed, content); SiteRecoveryMigrationItemResource result = lro.Value; @@ -298,7 +301,7 @@ public async Task TestMigrate_TestMigrateItem() [Ignore("Only validating compilation of examples")] public async Task TestMigrateCleanup_TestMigrateCleanup() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationMigrationItems_TestMigrateCleanup.json // this example is just showing the usage of "ReplicationMigrationItems_TestMigrateCleanup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkCollection.cs index 33604a3de252..a64184834b60 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryNetworkCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsANetworkWithSpecifiedServerIdAndNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_Get.json // this example is just showing the usage of "ReplicationNetworks_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 @@ -54,7 +54,7 @@ public async Task Get_GetsANetworkWithSpecifiedServerIdAndNetworkName() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfNetworksUnderAFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationNetworks_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfNetworksUnderAFabric() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsANetworkWithSpecifiedServerIdAndNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_Get.json // this example is just showing the usage of "ReplicationNetworks_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_GetsANetworkWithSpecifiedServerIdAndNetworkName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsANetworkWithSpecifiedServerIdAndNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_Get.json // this example is just showing the usage of "ReplicationNetworks_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingCollection.cs index a1d0a5cd0aae..06a464494c98 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryNetworkMappingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesNetworkMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Create.json // this example is just showing the usage of "ReplicationNetworkMappings_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 @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_CreatesNetworkMapping() [Ignore("Only validating compilation of examples")] public async Task Get_GetsNetworkMappingByName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Get.json // this example is just showing the usage of "ReplicationNetworkMappings_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 @@ -98,7 +98,7 @@ public async Task Get_GetsNetworkMappingByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsAllTheNetworkMappingsUnderANetwork() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_ListByReplicationNetworks.json // this example is just showing the usage of "ReplicationNetworkMappings_ListByReplicationNetworks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task GetAll_GetsAllTheNetworkMappingsUnderANetwork() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsNetworkMappingByName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Get.json // this example is just showing the usage of "ReplicationNetworkMappings_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 @@ -168,7 +168,7 @@ public async Task Exists_GetsNetworkMappingByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsNetworkMappingByName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Get.json // this example is just showing the usage of "ReplicationNetworkMappings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingResource.cs index 560ed7d2f262..3525c8e2c541 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkMappingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryNetworkMappingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsNetworkMappingByName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Get.json // this example is just showing the usage of "ReplicationNetworkMappings_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_GetsNetworkMappingByName() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteNetworkMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Delete.json // this example is just showing the usage of "ReplicationNetworkMappings_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 @@ -82,7 +82,7 @@ public async Task Delete_DeleteNetworkMapping() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesNetworkMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworkMappings_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworkMappings_Update.json // this example is just showing the usage of "ReplicationNetworkMappings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkResource.cs index 64ed3e42080c..39158324ffcb 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryNetworkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryNetworkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsANetworkWithSpecifiedServerIdAndNetworkName() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationNetworks_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationNetworks_Get.json // this example is just showing the usage of "ReplicationNetworks_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointCollection.cs index 8562905b6c2d..6b80f30132dc 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryPointCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsARecoveryPoint() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/RecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/RecoveryPoints_Get.json // this example is just showing the usage of "RecoveryPoints_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_GetsARecoveryPoint() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfRecoveryPointsForAReplicationProtectedItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/RecoveryPoints_ListByReplicationProtectedItems.json // this example is just showing the usage of "RecoveryPoints_ListByReplicationProtectedItems" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +95,7 @@ public async Task GetAll_GetsTheListOfRecoveryPointsForAReplicationProtectedItem [Ignore("Only validating compilation of examples")] public async Task Exists_GetsARecoveryPoint() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/RecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/RecoveryPoints_Get.json // this example is just showing the usage of "RecoveryPoints_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 Exists_GetsARecoveryPoint() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsARecoveryPoint() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/RecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/RecoveryPoints_Get.json // this example is just showing the usage of "RecoveryPoints_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointResource.cs index 70ad9648ed33..c81bf8d74906 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPointResource.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryPointResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsARecoveryPoint() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/RecoveryPoints_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/RecoveryPoints_Get.json // this example is just showing the usage of "RecoveryPoints_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyCollection.cs index 981c4931f78f..fd554babca56 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryPolicyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesThePolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Create.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CreatesThePolicy() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheRequestedPolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Get.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -94,7 +94,7 @@ public async Task Get_GetsTheRequestedPolicy() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfReplicationPolicies() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_List.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -130,7 +130,7 @@ public async Task GetAll_GetsTheListOfReplicationPolicies() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheRequestedPolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Get.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -160,7 +160,7 @@ public async Task Exists_GetsTheRequestedPolicy() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheRequestedPolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Get.json // this example is just showing the usage of "ReplicationPolicies_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyResource.cs index 2874507e89ee..168576d2d48d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryPolicyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryPolicyResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheRequestedPolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Get.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheRequestedPolicy() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteThePolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Delete.json // this example is just showing the usage of "ReplicationPolicies_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 @@ -78,7 +78,7 @@ public async Task Delete_DeleteThePolicy() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesThePolicy() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationPolicies_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationPolicies_Update.json // this example is just showing the usage of "ReplicationPolicies_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemCollection.cs index 360e47e19663..2523d6b54cb1 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryProtectableItemCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAProtectableItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectableItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectableItems_Get.json // this example is just showing the usage of "ReplicationProtectableItems_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 @@ -55,7 +55,7 @@ public async Task Get_GetsTheDetailsOfAProtectableItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfProtectableItems() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectableItems_ListByReplicationProtectionContainers.json // this example is just showing the usage of "ReplicationProtectableItems_ListByReplicationProtectionContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfProtectableItems() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAProtectableItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectableItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectableItems_Get.json // this example is just showing the usage of "ReplicationProtectableItems_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 @@ -125,7 +125,7 @@ public async Task Exists_GetsTheDetailsOfAProtectableItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAProtectableItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectableItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectableItems_Get.json // this example is just showing the usage of "ReplicationProtectableItems_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemResource.cs index de8080302d57..1b4625d7ef5d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectableItemResource.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryProtectableItemResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAProtectableItem() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectableItems_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectableItems_Get.json // this example is just showing the usage of "ReplicationProtectableItems_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerCollection.cs index 8279e1c6466e..271f87381e12 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SiteRecoveryProtectionContainerCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheProtectionContainerDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_Get.json // this example is just showing the usage of "ReplicationProtectionContainers_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 @@ -54,7 +54,7 @@ public async Task Get_GetsTheProtectionContainerDetails() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfProtectionContainerForAFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationProtectionContainers_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfProtectionContainerForAFabric() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheProtectionContainerDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_Get.json // this example is just showing the usage of "ReplicationProtectionContainers_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_GetsTheProtectionContainerDetails() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheProtectionContainerDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_Get.json // this example is just showing the usage of "ReplicationProtectionContainers_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerResource.cs index 9ac2f70c0a8b..2c67e79c437a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryProtectionContainerResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryProtectionContainerResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheProtectionContainerDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_Get.json // this example is just showing the usage of "ReplicationProtectionContainers_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_GetsTheProtectionContainerDetails() [Ignore("Only validating compilation of examples")] public async Task DiscoverProtectableItem_AddsAProtectableItemToTheReplicationProtectionContainer() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_DiscoverProtectableItem.json // this example is just showing the usage of "ReplicationProtectionContainers_DiscoverProtectableItem" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +95,7 @@ public async Task DiscoverProtectableItem_AddsAProtectableItemToTheReplicationPr [Ignore("Only validating compilation of examples")] public async Task Delete_RemovesAProtectionContainer() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_Delete.json // this example is just showing the usage of "ReplicationProtectionContainers_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 @@ -119,11 +119,67 @@ public async Task Delete_RemovesAProtectionContainer() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SwitchClusterProtection_SwitchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_SwitchClusterProtection.json + // this example is just showing the usage of "ReplicationProtectionContainers_SwitchClusterProtection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // invoke the operation + SwitchClusterProtectionContent content = new SwitchClusterProtectionContent + { + Properties = new SwitchClusterProtectionContentProperties + { + ReplicationProtectionClusterName = "testcluster", + ProviderSpecificDetails = new A2ASwitchClusterProtectionContent + { + RecoveryContainerId = new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric-rec-westus/replicationProtectionContainers/rec-cloud-westus"), + PolicyId = new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/klncksan"), + ProtectedItemsDetail = {new A2AProtectedItemDetail +{ +VmManagedDisks = {new A2AVmManagedDiskDetails("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourcegroups/clustertestrg-19-01/providers/microsoft.compute/disks/sdgql0-osdisk", new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/clustertestrg-19-01/providers/Microsoft.Storage/storageAccounts/ix701lvaasrcache"), new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ClusterTestRG-19-01-asr"))}, +RecoveryResourceGroupId = new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ClusterTestRG-19-01-asr"), +ReplicationProtectedItemName = "yNdYnDYKZ7hYU7zyVeBychFBCyAbEkrJcJNUarDrXio", +}, new A2AProtectedItemDetail +{ +VmManagedDisks = {new A2AVmManagedDiskDetails("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourcegroups/clustertestrg-19-01/providers/microsoft.compute/disks/sdgql1-osdisk", new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/clustertestrg-19-01/providers/Microsoft.Storage/storageAccounts/ix701lvaasrcache"), new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ClusterTestRG-19-01-asr"))}, +RecoveryResourceGroupId = new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ClusterTestRG-19-01-asr"), +ReplicationProtectedItemName = "kdUdWvpVnm3QgOQPHoVMX8YAtAO8OC4kKNjt40ERSr4", +}}, + }, + }, + }; + ArmOperation lro = await siteRecoveryProtectionContainer.SwitchClusterProtectionAsync(WaitUntil.Completed, content); + SiteRecoveryProtectionContainerResource 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 + SiteRecoveryProtectionContainerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task SwitchProtection_SwitchesProtectionFromOneContainerToAnotherOrOneReplicationProviderToAnother() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationProtectionContainers_SwitchProtection.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionContainers_SwitchProtection.json // this example is just showing the usage of "ReplicationProtectionContainers_SwitchProtection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanCollection.cs index 5be2f5e88590..f7b6b324c8d6 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryRecoveryPlanCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreatesARecoveryPlanWithTheGivenDetails() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Create.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -72,7 +72,7 @@ public async Task CreateOrUpdate_CreatesARecoveryPlanWithTheGivenDetails() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheRequestedRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Get.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -106,7 +106,7 @@ public async Task Get_GetsTheRequestedRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfRecoveryPlans() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_List.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -142,7 +142,7 @@ public async Task GetAll_GetsTheListOfRecoveryPlans() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheRequestedRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Get.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -172,7 +172,7 @@ public async Task Exists_GetsTheRequestedRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheRequestedRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Get.json // this example is just showing the usage of "ReplicationRecoveryPlans_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanResource.cs index 133e29ebbb96..22b5849bcdbf 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryRecoveryPlanResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryRecoveryPlanResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheRequestedRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Get.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheRequestedRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesTheSpecifiedRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Delete.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -78,7 +78,7 @@ public async Task Delete_DeletesTheSpecifiedRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesTheGivenRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Update.json // this example is just showing the usage of "ReplicationRecoveryPlans_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 @@ -142,7 +142,7 @@ public async Task Update_UpdatesTheGivenRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task FailoverCancel_ExecuteCancelFailoverOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_FailoverCancel.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_FailoverCancel.json // this example is just showing the usage of "ReplicationRecoveryPlans_FailoverCancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 FailoverCancel_ExecuteCancelFailoverOfTheRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task FailoverCommit_ExecuteCommitFailoverOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_FailoverCommit.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_FailoverCommit.json // this example is just showing the usage of "ReplicationRecoveryPlans_FailoverCommit" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task FailoverCommit_ExecuteCommitFailoverOfTheRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task PlannedFailover_ExecutePlannedFailoverOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_PlannedFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_PlannedFailover.json // this example is just showing the usage of "ReplicationRecoveryPlans_PlannedFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +242,7 @@ public async Task PlannedFailover_ExecutePlannedFailoverOfTheRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task Reprotect_ExecuteReprotectOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_Reprotect.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_Reprotect.json // this example is just showing the usage of "ReplicationRecoveryPlans_Reprotect" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -274,7 +274,7 @@ public async Task Reprotect_ExecuteReprotectOfTheRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task TestFailover_ExecuteTestFailoverOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_TestFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_TestFailover.json // this example is just showing the usage of "ReplicationRecoveryPlans_TestFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -311,7 +311,7 @@ public async Task TestFailover_ExecuteTestFailoverOfTheRecoveryPlan() [Ignore("Only validating compilation of examples")] public async Task TestFailoverCleanup_ExecuteTestFailoverCleanupOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_TestFailoverCleanup.json // this example is just showing the usage of "ReplicationRecoveryPlans_TestFailoverCleanup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -347,7 +347,7 @@ public async Task TestFailoverCleanup_ExecuteTestFailoverCleanupOfTheRecoveryPla [Ignore("Only validating compilation of examples")] public async Task UnplannedFailover_ExecuteUnplannedFailoverOfTheRecoveryPlan() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryPlans_UnplannedFailover.json // this example is just showing the usage of "ReplicationRecoveryPlans_UnplannedFailover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderCollection.cs index b46954da0526..848334854c91 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryServicesProviderCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AddsARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Create.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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 @@ -57,7 +57,7 @@ public async Task CreateOrUpdate_AddsARecoveryServicesProvider() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Get.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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_GetsTheDetailsOfARecoveryServicesProvider() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfRegisteredRecoveryServicesProvidersForTheFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfRegisteredRecoveryServicesProvidersForTheF [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Get.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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 @@ -160,7 +160,7 @@ public async Task Exists_GetsTheDetailsOfARecoveryServicesProvider() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Get.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderResource.cs index 4584b74c4be1..2cff18358c63 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryServicesProviderResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryServicesProviderResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Get.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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_GetsTheDetailsOfARecoveryServicesProvider() [Ignore("Only validating compilation of examples")] public async Task Update_AddsARecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Create.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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 @@ -86,7 +86,7 @@ public async Task Update_AddsARecoveryServicesProvider() [Ignore("Only validating compilation of examples")] public async Task RefreshProvider_RefreshDetailsFromTheRecoveryServicesProvider() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_RefreshProvider.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_RefreshProvider" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 RefreshProvider_RefreshDetailsFromTheRecoveryServicesProvider( [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesProviderFromFabricNoteDeletingProviderForAnyFabricOtherThanSingleHostIsUnsupportedToMaintainBackwardCompatibilityForReleasedClientsTheObjectDeleteRspInputIsUsedIfTheObjectIsEmptyWeAssumeThatItIsOldClientAndContinueTheOldBehavior() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationRecoveryServicesProviders_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationRecoveryServicesProviders_Delete.json // this example is just showing the usage of "ReplicationRecoveryServicesProviders_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterCollection.cs index 819790a7a642..2a2a70c8c82f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryVCenterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AddVCenter() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Create.json // this example is just showing the usage of "ReplicationvCenters_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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_AddVCenter() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAVCenter() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Get.json // this example is just showing the usage of "ReplicationvCenters_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 @@ -103,7 +103,7 @@ public async Task Get_GetsTheDetailsOfAVCenter() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfVCenterRegisteredUnderAFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationvCenters_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +140,7 @@ public async Task GetAll_GetsTheListOfVCenterRegisteredUnderAFabric() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAVCenter() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Get.json // this example is just showing the usage of "ReplicationvCenters_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 @@ -171,7 +171,7 @@ public async Task Exists_GetsTheDetailsOfAVCenter() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAVCenter() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Get.json // this example is just showing the usage of "ReplicationvCenters_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterResource.cs index 4c94af298a12..d8418d577d74 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVCenterResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryVCenterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAVCenter() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Get.json // this example is just showing the usage of "ReplicationvCenters_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_GetsTheDetailsOfAVCenter() [Ignore("Only validating compilation of examples")] public async Task Delete_RemoveVCenterOperation() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Delete.json // this example is just showing the usage of "ReplicationvCenters_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 @@ -81,7 +81,7 @@ public async Task Delete_RemoveVCenterOperation() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateVCenterOperation() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationvCenters_Update.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationvCenters_Update.json // this example is just showing the usage of "ReplicationvCenters_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingCollection.cs index 08a94531a9b4..e0a1643134e9 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteRecoveryVaultSettingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_UpdatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Create.json // this example is just showing the usage of "ReplicationVaultSetting_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 @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_UpdatesVaultSettingAVaultSettingObjectIsASingle [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheVaultSetting() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Get.json // this example is just showing the usage of "ReplicationVaultSetting_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 @@ -94,7 +94,7 @@ public async Task Get_GetsTheVaultSetting() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfVaultSetting() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_List.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_List.json // this example is just showing the usage of "ReplicationVaultSetting_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 @@ -130,7 +130,7 @@ public async Task GetAll_GetsTheListOfVaultSetting() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheVaultSetting() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Get.json // this example is just showing the usage of "ReplicationVaultSetting_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 @@ -160,7 +160,7 @@ public async Task Exists_GetsTheVaultSetting() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheVaultSetting() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Get.json // this example is just showing the usage of "ReplicationVaultSetting_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingResource.cs index c0b334704649..57946d84d7a5 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_SiteRecoveryVaultSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SiteRecoveryVaultSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheVaultSetting() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Get.json // this example is just showing the usage of "ReplicationVaultSetting_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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheVaultSetting() [Ignore("Only validating compilation of examples")] public async Task Update_UpdatesVaultSettingAVaultSettingObjectIsASingletonPerVaultAndItIsAlwaysPresentByDefault() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationVaultSetting_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationVaultSetting_Create.json // this example is just showing the usage of "ReplicationVaultSetting_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 diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationCollection.cs index 6bbc82ff31c8..b3fb3835b24a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_StorageClassificationCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAStorageClassification() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_Get.json // this example is just showing the usage of "ReplicationStorageClassifications_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 @@ -54,7 +54,7 @@ public async Task Get_GetsTheDetailsOfAStorageClassification() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfStorageClassificationObjectsUnderAFabric() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_ListByReplicationFabrics.json // this example is just showing the usage of "ReplicationStorageClassifications_ListByReplicationFabrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetAll_GetsTheListOfStorageClassificationObjectsUnderAFabric() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAStorageClassification() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_Get.json // this example is just showing the usage of "ReplicationStorageClassifications_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_GetsTheDetailsOfAStorageClassification() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAStorageClassification() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_Get.json // this example is just showing the usage of "ReplicationStorageClassifications_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingCollection.cs index 9af19abc4081..a1f74fd63a32 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_StorageClassificationMappingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Create.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 CreateOrUpdate_CreateStorageClassificationMapping() [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Get.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 @@ -97,7 +97,7 @@ public async Task Get_GetsTheDetailsOfAStorageClassificationMapping() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfStorageClassificationMappingsObjectsUnderAStorage() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_ListByReplicationStorageClassifications" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_GetsTheListOfStorageClassificationMappingsObjectsUnderA [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheDetailsOfAStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Get.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 @@ -167,7 +167,7 @@ public async Task Exists_GetsTheDetailsOfAStorageClassificationMapping() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheDetailsOfAStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Get.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingResource.cs index a3c93980b2fb..532c52f7b9ac 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationMappingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_StorageClassificationMappingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Get.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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_GetsTheDetailsOfAStorageClassificationMapping() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Delete.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Delete.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 @@ -82,7 +82,7 @@ public async Task Delete_DeleteAStorageClassificationMapping() [Ignore("Only validating compilation of examples")] public async Task Update_CreateStorageClassificationMapping() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassificationMappings_Create.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassificationMappings_Create.json // this example is just showing the usage of "ReplicationStorageClassificationMappings_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 diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationResource.cs index cffeec0d0916..7f21daa0c752 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_StorageClassificationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_StorageClassificationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheDetailsOfAStorageClassification() { - // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-08-01/examples/ReplicationStorageClassifications_Get.json + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationStorageClassifications_Get.json // this example is just showing the usage of "ReplicationStorageClassifications_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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs new file mode 100644 index 000000000000..0d8ad39f337b --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs @@ -0,0 +1,215 @@ +// 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.RecoveryServicesSiteRecovery.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Create.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection collection = siteRecoveryProtectionContainer.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters(); + + // invoke the operation + string replicationProtectionClusterName = "cluster12"; + ReplicationProtectionClusterData data = new ReplicationProtectionClusterData + { + Properties = new ReplicationProtectionClusterProperties + { + RecoveryContainerId = new ResourceIdentifier("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/centraluseuap/replicationProtectionContainers/centraluseuap-container"), + ProviderSpecificDetails = new A2AReplicationProtectionClusterDetails(), + PolicyId = new ResourceIdentifier("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/24-hour-retention-policy"), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, replicationProtectionClusterName, data); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheDetailsOfAReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Get.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection collection = siteRecoveryProtectionContainer.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters(); + + // invoke the operation + string replicationProtectionClusterName = "cluster1"; + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource result = await collection.GetAsync(replicationProtectionClusterName); + + // 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GetsTheListOfReplicationProtectionClustersInFabricContainer() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_ListByReplicationProtectionContainers.json + // this example is just showing the usage of "ReplicationProtectionClusters_ListByReplicationProtectionContainers" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection collection = siteRecoveryProtectionContainer.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters(); + + // invoke the operation and iterate over the result + await foreach (VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheDetailsOfAReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Get.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection collection = siteRecoveryProtectionContainer.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters(); + + // invoke the operation + string replicationProtectionClusterName = "cluster1"; + bool result = await collection.ExistsAsync(replicationProtectionClusterName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheDetailsOfAReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Get.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 SiteRecoveryProtectionContainerResource created on azure + // for more information of creating SiteRecoveryProtectionContainerResource, please refer to the document of SiteRecoveryProtectionContainerResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + ResourceIdentifier siteRecoveryProtectionContainerResourceId = SiteRecoveryProtectionContainerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + SiteRecoveryProtectionContainerResource siteRecoveryProtectionContainer = client.GetSiteRecoveryProtectionContainerResource(siteRecoveryProtectionContainerResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection collection = siteRecoveryProtectionContainer.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters(); + + // invoke the operation + string replicationProtectionClusterName = "cluster1"; + NullableResponse response = await collection.GetIfExistsAsync(replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs new file mode 100644 index 000000000000..647a0686342f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs @@ -0,0 +1,133 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_TracksTheReplicationProtectionClusterAsyncOperation() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_GetOperationResults.json + // this example is just showing the usage of "ReplicationProtectionClusters_GetOperationResults" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults(); + + // invoke the operation + ResourceIdentifier jobId = new ResourceIdentifier("ea63a935-59d5-4b12-aff2-98773f63c116"); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource result = await collection.GetAsync(jobId); + + // 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_TracksTheReplicationProtectionClusterAsyncOperation() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_GetOperationResults.json + // this example is just showing the usage of "ReplicationProtectionClusters_GetOperationResults" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults(); + + // invoke the operation + ResourceIdentifier jobId = new ResourceIdentifier("ea63a935-59d5-4b12-aff2-98773f63c116"); + bool result = await collection.ExistsAsync(jobId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_TracksTheReplicationProtectionClusterAsyncOperation() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_GetOperationResults.json + // this example is just showing the usage of "ReplicationProtectionClusters_GetOperationResults" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // get the collection of this VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection collection = vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults(); + + // invoke the operation + ResourceIdentifier jobId = new ResourceIdentifier("ea63a935-59d5-4b12-aff2-98773f63c116"); + NullableResponse response = await collection.GetIfExistsAsync(jobId); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs new file mode 100644 index 000000000000..fc09883f9104 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs @@ -0,0 +1,52 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_TracksTheReplicationProtectionClusterAsyncOperation() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_GetOperationResults.json + // this example is just showing the usage of "ReplicationProtectionClusters_GetOperationResults" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier jobId = new ResourceIdentifier("ea63a935-59d5-4b12-aff2-98773f63c116"); + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, jobId); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResult = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResourceId); + + // invoke the operation + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource result = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResult.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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs new file mode 100644 index 000000000000..62c7f2de7a41 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/samples/Generated/Samples/Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs @@ -0,0 +1,358 @@ +// 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.RecoveryServicesSiteRecovery.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Samples +{ + public partial class Sample_VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheDetailsOfAReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Get.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource result = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_PurgeTheReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Purge.json + // this example is just showing the usage of "ReplicationProtectionClusters_Purge" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster1"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateReplicationProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_Create.json + // this example is just showing the usage of "ReplicationProtectionClusters_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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster12"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ReplicationProtectionClusterData data = new ReplicationProtectionClusterData + { + Properties = new ReplicationProtectionClusterProperties + { + RecoveryContainerId = new ResourceIdentifier("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/centraluseuap/replicationProtectionContainers/centraluseuap-container"), + ProviderSpecificDetails = new A2AReplicationProtectionClusterDetails(), + PolicyId = new ResourceIdentifier("/Subscriptions/c183865e-6077-46f2-a3b1-deb0f4f4650a/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationPolicies/24-hour-retention-policy"), + }, + }; + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.UpdateAsync(WaitUntil.Completed, data); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ApplyRecoveryPoint_ExecuteTheChangeRecoveryPointOperationForCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_ApplyRecoveryPoint.json + // this example is just showing the usage of "ReplicationProtectionClusters_ApplyRecoveryPoint" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ApplyClusterRecoveryPointContent content = new ApplyClusterRecoveryPointContent(new ApplyClusterRecoveryPointContentProperties(new A2AApplyClusterRecoveryPointContent()) + { + ClusterRecoveryPointId = new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/shashankvaultpvt/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectionClusters/testcluster/recoveryPoints/cc48b7f3-b267-432b-ad76-45528974dc62"), + IndividualNodeRecoveryPoints = { new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/shashankvaultpvt/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectedItems/testVM/recoveryPoints/b5c2051b-79e3-41ad-9d25-244f6ef8ce7d") }, + }); + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.ApplyRecoveryPointAsync(WaitUntil.Completed, content); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task FailoverCommit_ExecuteCommitFailoverForCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_FailoverCommit.json + // this example is just showing the usage of "ReplicationProtectionClusters_FailoverCommit" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.FailoverCommitAsync(WaitUntil.Completed); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RepairReplication_ResynchronizeOrRepairReplicationOfProtectionCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_RepairReplication.json + // this example is just showing the usage of "ReplicationProtectionClusters_RepairReplication" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "c183865e-6077-46f2-a3b1-deb0f4f4650a"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "eastus"; + string protectionContainerName = "eastus-container"; + string replicationProtectionClusterName = "cluster12"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.RepairReplicationAsync(WaitUntil.Completed); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task TestFailover_ExecuteTestFailoverForCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_TestFailover.json + // this example is just showing the usage of "ReplicationProtectionClusters_TestFailover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ClusterTestFailoverContent content = new ClusterTestFailoverContent(new ClusterTestFailoverContentProperties + { + FailoverDirection = FailoverDirection.PrimaryToRecovery, + NetworkType = "VmNetworkAsInput", + NetworkId = new ResourceIdentifier("/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ClusterTestRG-19-01-asr/providers/Microsoft.Network/virtualNetworks/adVNET-asr"), + ProviderSpecificDetails = new A2AClusterTestFailoverContent + { + ClusterRecoveryPointId = new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectionClusters/testcluster/recoveryPoints/cc48b7f3-b267-432b-ad76-45528974dc62"), + IndividualNodeRecoveryPoints = { "/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectedItems/testVM/recoveryPoints/b5c2051b-79e3-41ad-9d25-244f6ef8ce7d" }, + }, + }); + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.TestFailoverAsync(WaitUntil.Completed, content); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task TestFailoverCleanup_ExecuteTestFailoverCleanupForCluster() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_TestFailoverCleanup.json + // this example is just showing the usage of "ReplicationProtectionClusters_TestFailoverCleanup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ClusterTestFailoverCleanupContent content = new ClusterTestFailoverCleanupContent(new ClusterTestFailoverCleanupContentProperties + { + Comments = "Test Failover Cleanup", + }); + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.TestFailoverCleanupAsync(WaitUntil.Completed, content); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task UnplannedFailover_ExecuteUnplannedClusterFailover() + { + // Generated from example definition: specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ReplicationProtectionClusters_UnplannedFailover.json + // this example is just showing the usage of "ReplicationProtectionClusters_UnplannedFailover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource created on azure + // for more information of creating VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource, please refer to the document of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource + string subscriptionId = "7c943c1b-5122-4097-90c8-861411bdd574"; + string resourceGroupName = "resourceGroupPS1"; + string resourceName = "vault1"; + string fabricName = "fabric-pri-eastus"; + string protectionContainerName = "pri-cloud-eastus"; + string replicationProtectionClusterName = "testcluster"; + ResourceIdentifier vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId = VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster = client.GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResourceId); + + // invoke the operation + ClusterUnplannedFailoverContent content = new ClusterUnplannedFailoverContent(new ClusterUnplannedFailoverContentProperties + { + FailoverDirection = "primarytorecovery", + SourceSiteOperations = "NotRequired", + ProviderSpecificDetails = new A2AClusterUnplannedFailoverContent + { + ClusterRecoveryPointId = new ResourceIdentifier("/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectionClusters/testcluster/recoveryPoints/cc48b7f3-b267-432b-ad76-45528974dc62"), + IndividualNodeRecoveryPoints = { "/Subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/resourceGroupPS1/providers/Microsoft.RecoveryServices/vaults/vault1/replicationFabrics/fabric-pri-eastus/replicationProtectionContainers/pri-cloud-eastus/replicationProtectedItems/testVM/recoveryPoints/b5c2051b-79e3-41ad-9d25-244f6ef8ce7d" }, + }, + }); + ArmOperation lro = await vaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster.UnplannedFailoverAsync(WaitUntil.Completed, content); + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource 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 + ReplicationProtectionClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs index f9fce4c5c09f..30fddf9e5541 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ArmRecoveryServicesSiteRecoveryModelFactory.cs @@ -165,82 +165,6 @@ public static SiteRecoveryEventProperties SiteRecoveryEventProperties(string eve serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. - /// Source of error. - /// Type of error. - /// Level of error. - /// Category of error. - /// Error code. - /// Summary message of the entity. - /// Error message. - /// Possible causes of error. - /// Recommended action to resolve error. - /// Error creation time (UTC). - /// DRA error message. - /// ID of the entity. - /// The health error unique id. - /// Value indicating whether the health error is customer resolvable. - /// A new instance for mocking. - public static SiteRecoveryHealthError SiteRecoveryHealthError(IEnumerable innerHealthErrors = null, string errorSource = null, string errorType = null, string errorLevel = null, string errorCategory = null, string errorCode = null, string summaryMessage = null, string errorMessage = null, string possibleCauses = null, string recommendedAction = null, DateTimeOffset? creationTimeUtc = null, string recoveryProviderErrorMessage = null, string entityId = null, string errorId = null, HealthErrorCustomerResolvability? customerResolvability = null) - { - innerHealthErrors ??= new List(); - - return new SiteRecoveryHealthError( - innerHealthErrors?.ToList(), - errorSource, - errorType, - errorLevel, - errorCategory, - errorCode, - summaryMessage, - errorMessage, - possibleCauses, - recommendedAction, - creationTimeUtc, - recoveryProviderErrorMessage, - entityId, - errorId, - customerResolvability, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Source of error. - /// Type of error. - /// Level of error. - /// Category of error. - /// Error code. - /// Summary message of the entity. - /// Error message. - /// Possible causes of error. - /// Recommended action to resolve error. - /// Error creation time (UTC). - /// DRA error message. - /// ID of the entity. - /// The health error unique id. - /// Value indicating whether the health error is customer resolvable. - /// A new instance for mocking. - public static SiteRecoveryInnerHealthError SiteRecoveryInnerHealthError(string errorSource = null, string errorType = null, string errorLevel = null, string errorCategory = null, string errorCode = null, string summaryMessage = null, string errorMessage = null, string possibleCauses = null, string recommendedAction = null, DateTimeOffset? createdOn = null, string recoveryProviderErrorMessage = null, string entityId = null, string errorId = null, HealthErrorCustomerResolvability? customerResolvability = null) - { - return new SiteRecoveryInnerHealthError( - errorSource, - errorType, - errorLevel, - errorCategory, - errorCode, - summaryMessage, - errorMessage, - possibleCauses, - recommendedAction, - createdOn, - recoveryProviderErrorMessage, - entityId, - errorId, - customerResolvability, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -753,16 +677,6 @@ public static ReplicationProtectedItemProperties ReplicationProtectedItemPropert serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Scenario name. - /// ARM Id of the job being executed. - /// Start time of the workflow. - /// A new instance for mocking. - public static CurrentScenarioDetails CurrentScenarioDetails(string scenarioName = null, ResourceIdentifier jobId = null, DateTimeOffset? startOn = null) - { - return new CurrentScenarioDetails(scenarioName, jobId, startOn, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The recovery point Id. /// @@ -868,6 +782,152 @@ public static SiteRecoveryComputeSizeErrorDetails SiteRecoveryComputeSizeErrorDe return new SiteRecoveryComputeSizeErrorDetails(message, severity, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The custom data. + /// A new instance for mocking. + public static ReplicationProtectionClusterData ReplicationProtectionClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ReplicationProtectionClusterProperties properties = null) + { + return new ReplicationProtectionClusterData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of protection cluster type. + /// The friendly name of the primary fabric. + /// The fabric provider of the primary fabric. + /// The friendly name of recovery fabric. + /// The Arm Id of recovery fabric. + /// The name of primary protection container friendly name. + /// The name of recovery container friendly name. + /// The protection status. + /// The protection state description. + /// The Current active location of the Protection cluster. + /// The Test failover state. + /// The Test failover state description. + /// The allowed operations on the Replication protection cluster. + /// The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. + /// List of health errors. + /// The last successful failover time. + /// The last successful test failover time. + /// The name of Policy governing this PE. + /// The current scenario. + /// The recovery container Id. + /// The Agent cluster Id. + /// The cluster FQDN. + /// The List of cluster Node FQDNs. + /// The List of Protected Item Id's. + /// The provisioning state of the cluster. + /// A value indicating whether all nodes of the cluster are registered or not. + /// The registered node details. + /// + /// The Replication cluster provider custom settings. + /// 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 . + /// + /// The shared disk properties. + /// The Policy Id. + /// A new instance for mocking. + public static ReplicationProtectionClusterProperties ReplicationProtectionClusterProperties(string protectionClusterType = null, string primaryFabricFriendlyName = null, string primaryFabricProvider = null, string recoveryFabricFriendlyName = null, ResourceIdentifier recoveryFabricId = null, string primaryProtectionContainerFriendlyName = null, string recoveryProtectionContainerFriendlyName = null, string protectionState = null, string protectionStateDescription = null, string activeLocation = null, string testFailoverState = null, string testFailoverStateDescription = null, IEnumerable allowedOperations = null, string replicationHealth = null, IEnumerable healthErrors = null, DateTimeOffset? lastSuccessfulFailoverOn = null, DateTimeOffset? lastSuccessfulTestFailoverOn = null, string policyFriendlyName = null, CurrentScenarioDetails currentScenario = null, ResourceIdentifier recoveryContainerId = null, string agentClusterId = null, string clusterFqdn = null, IEnumerable clusterNodeFqdns = null, IEnumerable clusterProtectedItemIds = null, string provisioningState = null, bool? areAllClusterNodesRegistered = null, IEnumerable clusterRegisteredNodes = null, ReplicationClusterProviderSpecificSettings providerSpecificDetails = null, SharedDiskReplicationItemProperties sharedDiskProperties = null, ResourceIdentifier policyId = null) + { + allowedOperations ??= new List(); + healthErrors ??= new List(); + clusterNodeFqdns ??= new List(); + clusterProtectedItemIds ??= new List(); + clusterRegisteredNodes ??= new List(); + + return new ReplicationProtectionClusterProperties( + protectionClusterType, + primaryFabricFriendlyName, + primaryFabricProvider, + recoveryFabricFriendlyName, + recoveryFabricId, + primaryProtectionContainerFriendlyName, + recoveryProtectionContainerFriendlyName, + protectionState, + protectionStateDescription, + activeLocation, + testFailoverState, + testFailoverStateDescription, + allowedOperations?.ToList(), + replicationHealth, + healthErrors?.ToList(), + lastSuccessfulFailoverOn, + lastSuccessfulTestFailoverOn, + policyFriendlyName, + currentScenario, + recoveryContainerId, + agentClusterId, + clusterFqdn, + clusterNodeFqdns?.ToList(), + clusterProtectedItemIds?.ToList(), + provisioningState, + areAllClusterNodesRegistered, + clusterRegisteredNodes?.ToList(), + providerSpecificDetails, + sharedDiskProperties, + policyId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The cluster recovery point id to be passed to failover to a particular recovery point. + /// The list of individual node recovery points. + /// + /// The provider specific input for applying cluster recovery point. + /// 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 . + /// + /// A new instance for mocking. + public static ApplyClusterRecoveryPointContentProperties ApplyClusterRecoveryPointContentProperties(ResourceIdentifier clusterRecoveryPointId = null, IEnumerable individualNodeRecoveryPoints = null, ApplyClusterRecoveryPointProviderSpecificContent providerSpecificDetails = null) + { + individualNodeRecoveryPoints ??= new List(); + + return new ApplyClusterRecoveryPointContentProperties(clusterRecoveryPointId, individualNodeRecoveryPoints?.ToList(), providerSpecificDetails, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource type. + /// The recovery point properties. + /// A new instance for mocking. + public static ClusterRecoveryPointData ClusterRecoveryPointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string clusterRecoveryPointType = null, ClusterRecoveryPointProperties properties = null) + { + return new ClusterRecoveryPointData( + id, + name, + resourceType, + systemData, + clusterRecoveryPointType, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The recovery point time. + /// The recovery point type. + /// + /// The provider specific details for the recovery point. + /// 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 . + /// + /// A new instance for mocking. + public static ClusterRecoveryPointProperties ClusterRecoveryPointProperties(DateTimeOffset? recoveryPointOn = null, ClusterRecoveryPointType? recoveryPointType = null, ClusterProviderSpecificRecoveryPointDetails providerSpecificDetails = null) + { + return new ClusterRecoveryPointProperties(recoveryPointOn, recoveryPointType, providerSpecificDetails, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1172,7 +1232,7 @@ public static SiteRecoveryJobData SiteRecoveryJobData(ResourceIdentifier id = nu /// /// The custom job details like test failover job 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 . + /// The available derived classes include , , , , , , and . /// /// A new instance for mocking. public static SiteRecoveryJobProperties SiteRecoveryJobProperties(string activityId = null, string scenarioName = null, string friendlyName = null, string state = null, string stateDescription = null, IEnumerable tasks = null, IEnumerable errors = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable allowedActions = null, string targetObjectId = null, string targetObjectName = null, string targetInstanceType = null, SiteRecoveryJobDetails customDetails = null) @@ -1712,6 +1772,17 @@ public static A2AVmManagedDiskDetails A2AVmManagedDiskDetails(string diskId = nu serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// A value indicating whether the recovery point is multi VM consistent. + /// The list of nodes representing the cluster. + /// A new instance for mocking. + public static A2AClusterRecoveryPointDetails A2AClusterRecoveryPointDetails(RecoveryPointSyncType? recoveryPointSyncType = null, IEnumerable nodes = null) + { + nodes ??= new List(); + + return new A2AClusterRecoveryPointDetails("A2A", serializedAdditionalRawData: null, recoveryPointSyncType, nodes?.ToList()); + } + /// Initializes a new instance of . /// The fabric specific object Id of the virtual machine. /// The primary location for the virtual machine. @@ -1824,6 +1895,7 @@ public static A2ACrossClusterMigrationReplicationDetails A2ACrossClusterMigratio /// The list of vm managed disk details. /// The multi vm group name. /// The multi vm group id. + /// The replication protection cluster Id. /// The boot diagnostic storage account. /// The recovery disk encryption information (for two pass flows). /// The recovery availability zone. @@ -1834,7 +1906,7 @@ public static A2ACrossClusterMigrationReplicationDetails A2ACrossClusterMigratio /// The recovery capacity reservation group Id. /// A value indicating whether the auto protection is enabled. /// A new instance for mocking. - public static A2AEnableProtectionContent A2AEnableProtectionContent(ResourceIdentifier fabricObjectId = null, ResourceIdentifier recoveryContainerId = null, ResourceIdentifier recoveryResourceGroupId = null, string recoveryCloudServiceId = null, ResourceIdentifier recoveryAvailabilitySetId = null, ResourceIdentifier recoveryProximityPlacementGroupId = null, IEnumerable vmDisks = null, IEnumerable vmManagedDisks = null, string multiVmGroupName = null, string multiVmGroupId = null, ResourceIdentifier recoveryBootDiagStorageAccountId = null, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo = null, string recoveryAvailabilityZone = null, SiteRecoveryExtendedLocation recoveryExtendedLocation = null, ResourceIdentifier recoveryAzureNetworkId = null, string recoverySubnetName = null, ResourceIdentifier recoveryVirtualMachineScaleSetId = null, ResourceIdentifier recoveryCapacityReservationGroupId = null, AutoProtectionOfDataDisk? autoProtectionOfDataDisk = null) + public static A2AEnableProtectionContent A2AEnableProtectionContent(ResourceIdentifier fabricObjectId = null, ResourceIdentifier recoveryContainerId = null, ResourceIdentifier recoveryResourceGroupId = null, string recoveryCloudServiceId = null, ResourceIdentifier recoveryAvailabilitySetId = null, ResourceIdentifier recoveryProximityPlacementGroupId = null, IEnumerable vmDisks = null, IEnumerable vmManagedDisks = null, string multiVmGroupName = null, string multiVmGroupId = null, ResourceIdentifier protectionClusterId = null, ResourceIdentifier recoveryBootDiagStorageAccountId = null, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo = null, string recoveryAvailabilityZone = null, SiteRecoveryExtendedLocation recoveryExtendedLocation = null, ResourceIdentifier recoveryAzureNetworkId = null, string recoverySubnetName = null, ResourceIdentifier recoveryVirtualMachineScaleSetId = null, ResourceIdentifier recoveryCapacityReservationGroupId = null, AutoProtectionOfDataDisk? autoProtectionOfDataDisk = null) { vmDisks ??= new List(); vmManagedDisks ??= new List(); @@ -1852,6 +1924,7 @@ public static A2AEnableProtectionContent A2AEnableProtectionContent(ResourceIden vmManagedDisks?.ToList(), multiVmGroupName, multiVmGroupId, + protectionClusterId, recoveryBootDiagStorageAccountId, diskEncryptionInfo, recoveryAvailabilityZone, @@ -2017,72 +2090,6 @@ public static A2AProtectedDiskDetails A2AProtectedDiskDetails(Uri diskUri = null serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The managed disk Arm id. - /// The recovery disk resource group Arm Id. - /// Recovery target disk Arm Id. - /// Recovery replica disk Arm Id. - /// Recovery original target disk Arm Id. - /// The replica disk type. Its an optional value and will be same as source disk type if not user provided. - /// The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. - /// The recovery disk encryption set Id. - /// The primary disk encryption set Id. - /// The disk name. - /// The disk capacity in bytes. - /// The primary staging storage account. - /// The type of disk. - /// A value indicating whether resync is required for this disk. - /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - /// The data pending for replication in MB at staging account. - /// The data pending at source virtual machine in MB. - /// The disk state. - /// The disk level operations list. - /// A value indicating whether vm has encrypted os disk or not. - /// The secret URL / identifier (BEK). - /// The KeyVault resource id for secret (BEK). - /// A value indicating whether disk key got encrypted or not. - /// The key URL / identifier (KEK). - /// The KeyVault resource id for key (KEK). - /// The failover name for the managed disk. - /// The test failover name for the managed disk. - /// A new instance for mocking. - public static A2AProtectedManagedDiskDetails A2AProtectedManagedDiskDetails(string diskId = null, ResourceIdentifier recoveryResourceGroupId = null, ResourceIdentifier recoveryTargetDiskId = null, ResourceIdentifier recoveryReplicaDiskId = null, ResourceIdentifier recoveryOrignalTargetDiskId = null, string recoveryReplicaDiskAccountType = null, string recoveryTargetDiskAccountType = null, ResourceIdentifier recoveryDiskEncryptionSetId = null, ResourceIdentifier primaryDiskEncryptionSetId = null, string diskName = null, long? diskCapacityInBytes = null, ResourceIdentifier primaryStagingAzureStorageAccountId = null, string diskType = null, bool? isResyncRequired = null, int? monitoringPercentageCompletion = null, string monitoringJobType = null, double? dataPendingInStagingStorageAccountInMB = null, double? dataPendingAtSourceAgentInMB = null, string diskState = null, IEnumerable allowedDiskLevelOperation = null, bool? isDiskEncrypted = null, string secretIdentifier = null, ResourceIdentifier dekKeyVaultArmId = null, bool? isDiskKeyEncrypted = null, string keyIdentifier = null, ResourceIdentifier kekKeyVaultArmId = null, string failoverDiskName = null, string tfoDiskName = null) - { - allowedDiskLevelOperation ??= new List(); - - return new A2AProtectedManagedDiskDetails( - diskId, - recoveryResourceGroupId, - recoveryTargetDiskId, - recoveryReplicaDiskId, - recoveryOrignalTargetDiskId, - recoveryReplicaDiskAccountType, - recoveryTargetDiskAccountType, - recoveryDiskEncryptionSetId, - primaryDiskEncryptionSetId, - diskName, - diskCapacityInBytes, - primaryStagingAzureStorageAccountId, - diskType, - isResyncRequired, - monitoringPercentageCompletion, - monitoringJobType, - dataPendingInStagingStorageAccountInMB, - dataPendingAtSourceAgentInMB, - diskState, - allowedDiskLevelOperation?.ToList(), - isDiskEncrypted, - secretIdentifier, - dekKeyVaultArmId, - isDiskKeyEncrypted, - keyIdentifier, - kekKeyVaultArmId, - failoverDiskName, - tfoDiskName, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// A value indicating whether the auto update is enabled. /// The automation account arm id. @@ -2125,6 +2132,8 @@ public static A2ARecoveryPointDetails A2ARecoveryPointDetails(RecoveryPointSyncT /// The multi vm group name. /// Whether Multi VM group is auto created or specified by user. /// The management Id. + /// The replication protection cluster Id. + /// A value indicating if the cluster infra is ready or not. /// The list of protected disks. /// The list of unprotected disks. /// The list of protected managed disks. @@ -2169,7 +2178,7 @@ public static A2ARecoveryPointDetails A2ARecoveryPointDetails(RecoveryPointSyncT /// The recovery capacity reservation group Id. /// A value indicating the churn option selected by user. /// A new instance for mocking. - public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId = null, string initialPrimaryZone = null, AzureLocation? initialPrimaryFabricLocation = null, string initialRecoveryZone = null, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation = null, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation = null, AzureLocation? initialRecoveryFabricLocation = null, string multiVmGroupId = null, string multiVmGroupName = null, MultiVmGroupCreateOption? multiVmGroupCreateOption = null, string managementId = null, IEnumerable protectedDisks = null, IEnumerable unprotectedDisks = null, IEnumerable protectedManagedDisks = null, ResourceIdentifier recoveryBootDiagStorageAccountId = null, AzureLocation? primaryFabricLocation = null, AzureLocation? recoveryFabricLocation = null, string osType = null, string recoveryAzureVmSize = null, string recoveryAzureVmName = null, ResourceIdentifier recoveryAzureResourceGroupId = null, string recoveryCloudService = null, string recoveryAvailabilitySet = null, ResourceIdentifier selectedRecoveryAzureNetworkId = null, ResourceIdentifier selectedTfoAzureNetworkId = null, IEnumerable vmNics = null, A2AVmSyncedConfigDetails vmSyncedConfigDetails = null, int? monitoringPercentageCompletion = null, string monitoringJobType = null, DateTimeOffset? lastHeartbeat = null, string agentVersion = null, DateTimeOffset? agentExpireOn = null, bool? isReplicationAgentUpdateRequired = null, DateTimeOffset? agentCertificateExpireOn = null, bool? isReplicationAgentCertificateUpdateRequired = null, ResourceIdentifier recoveryFabricObjectId = null, string vmProtectionState = null, string vmProtectionStateDescription = null, string lifecycleId = null, ResourceIdentifier testFailoverRecoveryFabricObjectId = null, long? rpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, string primaryAvailabilityZone = null, string recoveryAvailabilityZone = null, SiteRecoveryExtendedLocation primaryExtendedLocation = null, SiteRecoveryExtendedLocation recoveryExtendedLocation = null, SiteRecoveryVmEncryptionType? vmEncryptionType = null, string tfoAzureVmName = null, string recoveryAzureGeneration = null, ResourceIdentifier recoveryProximityPlacementGroupId = null, AutoProtectionOfDataDisk? autoProtectionOfDataDisk = null, ResourceIdentifier recoveryVirtualMachineScaleSetId = null, ResourceIdentifier recoveryCapacityReservationGroupId = null, ChurnOptionSelected? churnOptionSelected = null) + public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId = null, string initialPrimaryZone = null, AzureLocation? initialPrimaryFabricLocation = null, string initialRecoveryZone = null, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation = null, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation = null, AzureLocation? initialRecoveryFabricLocation = null, string multiVmGroupId = null, string multiVmGroupName = null, MultiVmGroupCreateOption? multiVmGroupCreateOption = null, string managementId = null, string protectionClusterId = null, bool? isClusterInfraReady = null, IEnumerable protectedDisks = null, IEnumerable unprotectedDisks = null, IEnumerable protectedManagedDisks = null, ResourceIdentifier recoveryBootDiagStorageAccountId = null, AzureLocation? primaryFabricLocation = null, AzureLocation? recoveryFabricLocation = null, string osType = null, string recoveryAzureVmSize = null, string recoveryAzureVmName = null, ResourceIdentifier recoveryAzureResourceGroupId = null, string recoveryCloudService = null, string recoveryAvailabilitySet = null, ResourceIdentifier selectedRecoveryAzureNetworkId = null, ResourceIdentifier selectedTfoAzureNetworkId = null, IEnumerable vmNics = null, A2AVmSyncedConfigDetails vmSyncedConfigDetails = null, int? monitoringPercentageCompletion = null, string monitoringJobType = null, DateTimeOffset? lastHeartbeat = null, string agentVersion = null, DateTimeOffset? agentExpireOn = null, bool? isReplicationAgentUpdateRequired = null, DateTimeOffset? agentCertificateExpireOn = null, bool? isReplicationAgentCertificateUpdateRequired = null, ResourceIdentifier recoveryFabricObjectId = null, string vmProtectionState = null, string vmProtectionStateDescription = null, string lifecycleId = null, ResourceIdentifier testFailoverRecoveryFabricObjectId = null, long? rpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, string primaryAvailabilityZone = null, string recoveryAvailabilityZone = null, SiteRecoveryExtendedLocation primaryExtendedLocation = null, SiteRecoveryExtendedLocation recoveryExtendedLocation = null, SiteRecoveryVmEncryptionType? vmEncryptionType = null, string tfoAzureVmName = null, string recoveryAzureGeneration = null, ResourceIdentifier recoveryProximityPlacementGroupId = null, AutoProtectionOfDataDisk? autoProtectionOfDataDisk = null, ResourceIdentifier recoveryVirtualMachineScaleSetId = null, ResourceIdentifier recoveryCapacityReservationGroupId = null, ChurnOptionSelected? churnOptionSelected = null) { protectedDisks ??= new List(); unprotectedDisks ??= new List(); @@ -2190,6 +2199,8 @@ public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fab multiVmGroupName, multiVmGroupCreateOption, managementId, + protectionClusterId, + isClusterInfraReady, protectedDisks?.ToList(), unprotectedDisks?.ToList(), protectedManagedDisks?.ToList(), @@ -2235,15 +2246,6 @@ public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fab churnOptionSelected); } - /// Initializes a new instance of . - /// The source lun Id for the data disk. - /// A value indicating whether the disk auto protection is enabled. - /// A new instance for mocking. - public static A2AUnprotectedDiskDetails A2AUnprotectedDiskDetails(int? diskLunId = null, AutoProtectionOfDataDisk? diskAutoProtectionStatus = null) - { - return new A2AUnprotectedDiskDetails(diskLunId, diskAutoProtectionStatus, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The nic Id. /// The replica nic Id. @@ -2436,6 +2438,24 @@ public static A2AReplicationIntentDetails A2AReplicationIntentDetails(ResourceId automationAccountAuthenticationType); } + /// Initializes a new instance of . + /// The error code. + /// The error code enum. + /// The error message. + /// The possible causes. + /// The recommended action. + /// A new instance for mocking. + public static A2ASharedDiskIRErrorDetails A2ASharedDiskIRErrorDetails(string errorCode = null, string errorCodeEnum = null, string errorMessage = null, string possibleCauses = null, string recommendedAction = null) + { + return new A2ASharedDiskIRErrorDetails( + errorCode, + errorCodeEnum, + errorMessage, + possibleCauses, + recommendedAction, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Source zone info. /// The target zone info. @@ -2632,6 +2652,81 @@ public static SiteRecoveryVmDiskDetails SiteRecoveryVmDiskDetails(string vhdType serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// The test VM details. + /// A new instance for mocking. + public static ClusterFailoverJobDetails ClusterFailoverJobDetails(IReadOnlyDictionary affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + affectedObjectDetails ??= new Dictionary(); + protectedItemDetails ??= new List(); + + return new ClusterFailoverJobDetails("ClusterFailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// The name. + /// The friendly name. + /// The test Vm name. + /// The test Vm friendly name. + /// The network connection status. + /// The network friendly name. + /// The network subnet. + /// The recovery point Id. + /// The recovery point time. + /// A new instance for mocking. + public static FailoverReplicationProtectedItemDetails FailoverReplicationProtectedItemDetails(string name = null, string friendlyName = null, string testVmName = null, string testVmFriendlyName = null, string networkConnectionStatus = null, string networkFriendlyName = null, string subnet = null, ResourceIdentifier recoveryPointId = null, DateTimeOffset? recoveryPointOn = null) + { + return new FailoverReplicationProtectedItemDetails( + name, + friendlyName, + testVmName, + testVmFriendlyName, + networkConnectionStatus, + networkFriendlyName, + subnet, + recoveryPointId, + recoveryPointOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// ARM Id of the new replication protection cluster. + /// A new instance for mocking. + public static ClusterSwitchProtectionJobDetails ClusterSwitchProtectionJobDetails(IReadOnlyDictionary affectedObjectDetails = null, string newReplicationProtectionClusterId = null) + { + affectedObjectDetails ??= new Dictionary(); + + return new ClusterSwitchProtectionJobDetails("ClusterSwitchProtectionJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, newReplicationProtectionClusterId); + } + + /// Initializes a new instance of . + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// The test failover status. + /// The test failover comments. + /// The test network name. + /// The test network friendly name. + /// The test network type (see TestFailoverInput enum for possible values). + /// The test VM details. + /// A new instance for mocking. + public static ClusterTestFailoverJobDetails ClusterTestFailoverJobDetails(IReadOnlyDictionary affectedObjectDetails = null, string testFailoverStatus = null, string comments = null, string networkName = null, string networkFriendlyName = null, string networkType = null, IEnumerable protectedItemDetails = null) + { + affectedObjectDetails ??= new Dictionary(); + protectedItemDetails ??= new List(); + + return new ClusterTestFailoverJobDetails( + "ClusterTestFailoverJobDetails", + affectedObjectDetails, + serializedAdditionalRawData: null, + testFailoverStatus, + comments, + networkName, + networkFriendlyName, + networkType, + protectedItemDetails?.ToList()); + } + /// Initializes a new instance of . /// The list of inconsistent Vm details. /// A new instance for mocking. @@ -2784,32 +2879,6 @@ public static FailoverJobDetails FailoverJobDetails(IReadOnlyDictionary Initializes a new instance of . - /// The name. - /// The friendly name. - /// The test Vm name. - /// The test Vm friendly name. - /// The network connection status. - /// The network friendly name. - /// The network subnet. - /// The recovery point Id. - /// The recovery point time. - /// A new instance for mocking. - public static FailoverReplicationProtectedItemDetails FailoverReplicationProtectedItemDetails(string name = null, string friendlyName = null, string testVmName = null, string testVmFriendlyName = null, string networkConnectionStatus = null, string networkFriendlyName = null, string subnet = null, ResourceIdentifier recoveryPointId = null, DateTimeOffset? recoveryPointOn = null) - { - return new FailoverReplicationProtectedItemDetails( - name, - friendlyName, - testVmName, - testVmFriendlyName, - networkConnectionStatus, - networkFriendlyName, - subnet, - recoveryPointId, - recoveryPointOn, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// A value indicating the state of gateway operation. /// A value indicating the progress percentage of gateway operation. @@ -2895,10 +2964,25 @@ public static HyperVReplicaAzureEventDetails HyperVReplicaAzureEventDetails(stri /// Seed managed disk Id. /// The replica disk type. /// The disk encryption set ARM Id. + /// The disk type. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static HyperVReplicaAzureManagedDiskDetails HyperVReplicaAzureManagedDiskDetails(string diskId = null, string seedManagedDiskId = null, string replicaDiskType = null, ResourceIdentifier diskEncryptionSetId = null) + public static HyperVReplicaAzureManagedDiskDetails HyperVReplicaAzureManagedDiskDetails(string diskId = null, string seedManagedDiskId = null, string replicaDiskType = null, ResourceIdentifier diskEncryptionSetId = null, SiteRecoveryDiskAccountType? targetDiskAccountType = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { - return new HyperVReplicaAzureManagedDiskDetails(diskId, seedManagedDiskId, replicaDiskType, diskEncryptionSetId, serializedAdditionalRawData: null); + return new HyperVReplicaAzureManagedDiskDetails( + diskId, + seedManagedDiskId, + replicaDiskType, + diskEncryptionSetId, + targetDiskAccountType, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2950,6 +3034,7 @@ public static HyperVReplicaAzurePolicyDetails HyperVReplicaAzurePolicyDetails(in /// A value indicating whether managed disks should be used during failover. /// License Type of the VM to be used. /// The SQL Server license type. + /// The license type for Linux VM's. /// The last recovery point received time. /// The target VM tags. /// The tags for the seed managed disks. @@ -2957,8 +3042,9 @@ public static HyperVReplicaAzurePolicyDetails HyperVReplicaAzurePolicyDetails(in /// The tags for the target NICs. /// The list of protected managed disks. /// A value indicating all available inplace OS Upgrade configurations. + /// The target VM security profile. /// A new instance for mocking. - public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails = null, string recoveryAzureVmName = null, string recoveryAzureVmSize = null, string recoveryAzureStorageAccount = null, ResourceIdentifier recoveryAzureLogStorageAccountId = null, DateTimeOffset? lastReplicatedOn = null, long? rpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, string vmId = null, string vmProtectionState = null, string vmProtectionStateDescription = null, InitialReplicationDetails initialReplicationDetails = null, IEnumerable vmNics = null, ResourceIdentifier selectedRecoveryAzureNetworkId = null, string selectedSourceNicId = null, string encryption = null, SiteRecoveryOSDetails osDetails = null, int? sourceVmRamSizeInMB = null, int? sourceVmCpuCount = null, string enableRdpOnTargetOption = null, ResourceIdentifier recoveryAzureResourceGroupId = null, ResourceIdentifier recoveryAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, string useManagedDisks = null, string licenseType = null, string sqlServerLicenseType = null, DateTimeOffset? lastRecoveryPointReceived = null, IReadOnlyDictionary targetVmTags = null, IReadOnlyDictionary seedManagedDiskTags = null, IReadOnlyDictionary targetManagedDiskTags = null, IReadOnlyDictionary targetNicTags = null, IEnumerable protectedManagedDisks = null, IEnumerable allAvailableOSUpgradeConfigurations = null) + public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails = null, string recoveryAzureVmName = null, string recoveryAzureVmSize = null, string recoveryAzureStorageAccount = null, ResourceIdentifier recoveryAzureLogStorageAccountId = null, DateTimeOffset? lastReplicatedOn = null, long? rpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, string vmId = null, string vmProtectionState = null, string vmProtectionStateDescription = null, InitialReplicationDetails initialReplicationDetails = null, IEnumerable vmNics = null, ResourceIdentifier selectedRecoveryAzureNetworkId = null, string selectedSourceNicId = null, string encryption = null, SiteRecoveryOSDetails osDetails = null, int? sourceVmRamSizeInMB = null, int? sourceVmCpuCount = null, string enableRdpOnTargetOption = null, ResourceIdentifier recoveryAzureResourceGroupId = null, ResourceIdentifier recoveryAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, string useManagedDisks = null, string licenseType = null, string sqlServerLicenseType = null, LinuxLicenseType? linuxLicenseType = null, DateTimeOffset? lastRecoveryPointReceived = null, IReadOnlyDictionary targetVmTags = null, IReadOnlyDictionary seedManagedDiskTags = null, IReadOnlyDictionary targetManagedDiskTags = null, IReadOnlyDictionary targetNicTags = null, IEnumerable protectedManagedDisks = null, IEnumerable allAvailableOSUpgradeConfigurations = null, SecurityProfileProperties targetVmSecurityProfile = null) { azureVmDiskDetails ??= new List(); vmNics ??= new List(); @@ -2999,13 +3085,15 @@ public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplication useManagedDisks, licenseType, sqlServerLicenseType, + linuxLicenseType, lastRecoveryPointReceived, targetVmTags, seedManagedDiskTags, targetManagedDiskTags, targetNicTags, protectedManagedDisks?.ToList(), - allAvailableOSUpgradeConfigurations?.ToList()); + allAvailableOSUpgradeConfigurations?.ToList(), + targetVmSecurityProfile); } /// Initializes a new instance of . @@ -3024,8 +3112,9 @@ public static InitialReplicationDetails InitialReplicationDetails(string initial /// The OS Version. /// The OS Major Version. /// The OS Minor Version. + /// The OS name selected by user. /// A new instance for mocking. - public static SiteRecoveryOSDetails SiteRecoveryOSDetails(string osType = null, string productType = null, string osEdition = null, string osVersion = null, string osMajorVersion = null, string osMinorVersion = null) + public static SiteRecoveryOSDetails SiteRecoveryOSDetails(string osType = null, string productType = null, string osEdition = null, string osVersion = null, string osMajorVersion = null, string osMinorVersion = null, string userSelectedOSName = null) { return new SiteRecoveryOSDetails( osType, @@ -3034,6 +3123,7 @@ public static SiteRecoveryOSDetails SiteRecoveryOSDetails(string osType = null, osVersion, osMajorVersion, osMinorVersion, + userSelectedOSName, serializedAdditionalRawData: null); } @@ -3051,10 +3141,19 @@ public static OSUpgradeSupportedVersions OSUpgradeSupportedVersions(string suppo /// Initializes a new instance of . /// The disk Id. /// The target disk name. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static UpdateDiskContent UpdateDiskContent(string diskId = null, string targetDiskName = null) + public static UpdateDiskContent UpdateDiskContent(string diskId = null, string targetDiskName = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { - return new UpdateDiskContent(diskId, targetDiskName, serializedAdditionalRawData: null); + return new UpdateDiskContent( + diskId, + targetDiskName, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -3828,6 +3927,30 @@ public static InMageProtectedDiskDetails InMageProtectedDiskDetails(string diskI serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The disk Id. + /// The log storage account ARM Id. + /// The disk type. + /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. + /// A new instance for mocking. + public static InMageRcmDiskContent InMageRcmDiskContent(string diskId = null, ResourceIdentifier logStorageAccountId = null, SiteRecoveryDiskAccountType diskType = default, ResourceIdentifier diskEncryptionSetId = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) + { + return new InMageRcmDiskContent( + diskId, + logStorageAccountId, + diskType, + diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The error code. /// The error message. @@ -4179,25 +4302,26 @@ public static InMageRcmDiscoveredProtectedVmDetails InMageRcmDiscoveredProtected serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The disk Id. - /// The log storage account ARM Id. - /// The disk type. - /// The DiskEncryptionSet ARM Id. - /// A new instance for mocking. - public static InMageRcmDiskContent InMageRcmDiskContent(string diskId = null, ResourceIdentifier logStorageAccountId = null, SiteRecoveryDiskAccountType diskType = default, ResourceIdentifier diskEncryptionSetId = null) - { - return new InMageRcmDiskContent(diskId, logStorageAccountId, diskType, diskEncryptionSetId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The log storage account ARM Id. /// The disk type. /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static InMageRcmDisksDefaultContent InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId = null, SiteRecoveryDiskAccountType diskType = default, ResourceIdentifier diskEncryptionSetId = null) + public static InMageRcmDisksDefaultContent InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId = null, SiteRecoveryDiskAccountType diskType = default, ResourceIdentifier diskEncryptionSetId = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { - return new InMageRcmDisksDefaultContent(logStorageAccountId, diskType, diskEncryptionSetId, serializedAdditionalRawData: null); + return new InMageRcmDisksDefaultContent( + logStorageAccountId, + diskType, + diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -4219,10 +4343,22 @@ public static InMageRcmDisksDefaultContent InMageRcmDisksDefaultContent(Resource /// The run-as account Id. /// The process server Id. /// The multi VM group name. + /// The SQL Server license type. + /// The license type for Linux VM's. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The OS name selected by user. + /// The target VM security profile. /// A new instance for mocking. - public static InMageRcmEnableProtectionContent InMageRcmEnableProtectionContent(string fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, InMageRcmDisksDefaultContent disksDefault = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, string targetSubnetName = null, string testSubnetName = null, string targetVmName = null, string targetVmSize = null, SiteRecoveryLicenseType? licenseType = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, string runAsAccountId = null, Guid processServerId = default, string multiVmGroupName = null) + public static InMageRcmEnableProtectionContent InMageRcmEnableProtectionContent(string fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, InMageRcmDisksDefaultContent disksDefault = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, string targetSubnetName = null, string testSubnetName = null, string targetVmName = null, string targetVmSize = null, SiteRecoveryLicenseType? licenseType = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, string runAsAccountId = null, Guid processServerId = default, string multiVmGroupName = null, SiteRecoverySqlServerLicenseType? sqlServerLicenseType = null, LinuxLicenseType? linuxLicenseType = null, IEnumerable targetVmTags = null, IEnumerable seedManagedDiskTags = null, IEnumerable targetManagedDiskTags = null, IEnumerable targetNicTags = null, string userSelectedOSName = null, SecurityProfileProperties targetVmSecurityProfile = null) { disksToInclude ??= new List(); + targetVmTags ??= new List(); + seedManagedDiskTags ??= new List(); + targetManagedDiskTags ??= new List(); + targetNicTags ??= new List(); return new InMageRcmEnableProtectionContent( "InMageRcm", @@ -4244,7 +4380,15 @@ public static InMageRcmEnableProtectionContent InMageRcmEnableProtectionContent( targetBootDiagnosticsStorageAccountId, runAsAccountId, processServerId, - multiVmGroupName); + multiVmGroupName, + sqlServerLicenseType, + linuxLicenseType, + targetVmTags?.ToList(), + seedManagedDiskTags?.ToList(), + targetManagedDiskTags?.ToList(), + targetNicTags?.ToList(), + userSelectedOSName, + targetVmSecurityProfile); } /// Initializes a new instance of . @@ -4643,8 +4787,9 @@ public static InMageRcmMobilityAgentDetails InMageRcmMobilityAgentDetails(string /// Test subnet name. /// The test IP address. /// The test IP address type. + /// The target NIC name. /// A new instance for mocking. - public static InMageRcmNicDetails InMageRcmNicDetails(string nicId = null, string isPrimaryNic = null, string isSelectedForFailover = null, IPAddress sourceIPAddress = null, SiteRecoveryEthernetAddressType? sourceIPAddressType = null, ResourceIdentifier sourceNetworkId = null, string sourceSubnetName = null, IPAddress targetIPAddress = null, SiteRecoveryEthernetAddressType? targetIPAddressType = null, string targetSubnetName = null, string testSubnetName = null, IPAddress testIPAddress = null, SiteRecoveryEthernetAddressType? testIPAddressType = null) + public static InMageRcmNicDetails InMageRcmNicDetails(string nicId = null, string isPrimaryNic = null, string isSelectedForFailover = null, IPAddress sourceIPAddress = null, SiteRecoveryEthernetAddressType? sourceIPAddressType = null, ResourceIdentifier sourceNetworkId = null, string sourceSubnetName = null, IPAddress targetIPAddress = null, SiteRecoveryEthernetAddressType? targetIPAddressType = null, string targetSubnetName = null, string testSubnetName = null, IPAddress testIPAddress = null, SiteRecoveryEthernetAddressType? testIPAddressType = null, string targetNicName = null) { return new InMageRcmNicDetails( nicId, @@ -4660,6 +4805,7 @@ public static InMageRcmNicDetails InMageRcmNicDetails(string nicId = null, strin testSubnetName, testIPAddress, testIPAddressType, + targetNicName, serializedAdditionalRawData: null); } @@ -4671,8 +4817,9 @@ public static InMageRcmNicDetails InMageRcmNicDetails(string nicId = null, strin /// The target static IP address. /// The test subnet name. /// The test static IP address. + /// The target NIC name. /// A new instance for mocking. - public static InMageRcmNicContent InMageRcmNicContent(string nicId = null, string isPrimaryNic = null, string isSelectedForFailover = null, string targetSubnetName = null, IPAddress targetStaticIPAddress = null, string testSubnetName = null, IPAddress testStaticIPAddress = null) + public static InMageRcmNicContent InMageRcmNicContent(string nicId = null, string isPrimaryNic = null, string isSelectedForFailover = null, string targetSubnetName = null, IPAddress targetStaticIPAddress = null, string testSubnetName = null, IPAddress testStaticIPAddress = null, string targetNicName = null) { return new InMageRcmNicContent( nicId, @@ -4682,6 +4829,7 @@ public static InMageRcmNicContent InMageRcmNicContent(string nicId = null, strin targetStaticIPAddress, testSubnetName, testStaticIPAddress, + targetNicName, serializedAdditionalRawData: null); } @@ -4707,6 +4855,7 @@ public static InMageRcmPolicyDetails InMageRcmPolicyDetails(int? recoveryPointHi /// The disk name. /// A value indicating whether the disk is the OS disk. /// The disk capacity in bytes. + /// The disk state. /// The log storage account ARM Id. /// The DiskEncryptionSet ARM Id. /// The ARM Id of the seed managed disk. @@ -4718,14 +4867,20 @@ public static InMageRcmPolicyDetails InMageRcmPolicyDetails(int? recoveryPointHi /// A value indicating whether initial replication is complete or not. /// The initial replication details. /// The resync details. + /// The custom target Azure disk name. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static InMageRcmProtectedDiskDetails InMageRcmProtectedDiskDetails(string diskId = null, string diskName = null, string isOSDisk = null, long? capacityInBytes = null, ResourceIdentifier logStorageAccountId = null, ResourceIdentifier diskEncryptionSetId = null, string seedManagedDiskId = null, Uri seedBlobUri = null, string targetManagedDiskId = null, SiteRecoveryDiskAccountType? diskType = null, double? dataPendingInLogDataStoreInMB = null, double? dataPendingAtSourceAgentInMB = null, string isInitialReplicationComplete = null, InMageRcmSyncDetails irDetails = null, InMageRcmSyncDetails resyncDetails = null) + public static InMageRcmProtectedDiskDetails InMageRcmProtectedDiskDetails(string diskId = null, string diskName = null, string isOSDisk = null, long? capacityInBytes = null, DiskState? diskState = null, ResourceIdentifier logStorageAccountId = null, ResourceIdentifier diskEncryptionSetId = null, string seedManagedDiskId = null, Uri seedBlobUri = null, string targetManagedDiskId = null, SiteRecoveryDiskAccountType? diskType = null, double? dataPendingInLogDataStoreInMB = null, double? dataPendingAtSourceAgentInMB = null, string isInitialReplicationComplete = null, InMageRcmSyncDetails irDetails = null, InMageRcmSyncDetails resyncDetails = null, string customTargetDiskName = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { return new InMageRcmProtectedDiskDetails( diskId, diskName, isOSDisk, capacityInBytes, + diskState, logStorageAccountId, diskEncryptionSetId, seedManagedDiskId, @@ -4737,6 +4892,11 @@ public static InMageRcmProtectedDiskDetails InMageRcmProtectedDiskDetails(string isInitialReplicationComplete, irDetails, resyncDetails, + customTargetDiskName, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData: null); } @@ -4764,6 +4924,16 @@ public static InMageRcmSyncDetails InMageRcmSyncDetails(SiteRecoveryDiskReplicat serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The disk Id. + /// The disk name. + /// The disk capacity in bytes. + /// A new instance for mocking. + public static InMageRcmUnProtectedDiskDetails InMageRcmUnProtectedDiskDetails(string diskId = null, string diskName = null, long? capacityInBytes = null) + { + return new InMageRcmUnProtectedDiskDetails(diskId, diskName, capacityInBytes, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// A value indicating whether the flag for enable agent auto upgrade. /// A new instance for mocking. @@ -4795,6 +4965,7 @@ public static InMageRcmRecoveryPointDetails InMageRcmRecoveryPointDetails(string /// The IP address of the primary network interface. /// The target generation. /// License Type of the VM to be used. + /// The license type for Linux VM's. /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. /// Target VM name. /// The target VM size. @@ -4826,6 +4997,7 @@ public static InMageRcmRecoveryPointDetails InMageRcmRecoveryPointDetails(string /// The agent upgrade job Id. /// The agent version to which last agent upgrade was attempted. /// The list of protected disks. + /// The list of unprotected disks. /// A value indicating whether last agent upgrade was successful or not. /// A value indicating whether agent registration was successful after failover. /// The mobility agent information. @@ -4833,13 +5005,27 @@ public static InMageRcmRecoveryPointDetails InMageRcmRecoveryPointDetails(string /// The agent upgrade blocking error information. /// The network details. /// The discovered VM details. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The SQL Server license type. + /// A value indicating the inplace OS Upgrade version. + /// The OS name associated with VM. + /// The target VM security profile. /// A new instance for mocking. - public static InMageRcmReplicationDetails InMageRcmReplicationDetails(string internalIdentifier = null, string fabricDiscoveryMachineId = null, string multiVmGroupName = null, string discoveryType = null, Guid? processServerId = null, int? processorCoreCount = null, double? allocatedMemoryInMB = null, string processServerName = null, string runAsAccountId = null, string osType = null, string firmwareType = null, IPAddress primaryNicIPAddress = null, string targetGeneration = null, string licenseType = null, ResourceIdentifier storageAccountId = null, string targetVmName = null, string targetVmSize = null, ResourceIdentifier targetResourceGroupId = null, string targetLocation = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, ResourceIdentifier failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, long? lastRpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, ResourceIdentifier lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, long? initialReplicationProcessedBytes = null, long? initialReplicationTransferredBytes = null, VmReplicationProgressHealth? initialReplicationProgressHealth = null, int? resyncProgressPercentage = null, long? resyncProcessedBytes = null, long? resyncTransferredBytes = null, VmReplicationProgressHealth? resyncProgressHealth = null, string resyncRequired = null, SiteRecoveryResyncState? resyncState = null, MobilityAgentUpgradeState? agentUpgradeState = null, string lastAgentUpgradeType = null, string agentUpgradeJobId = null, string agentUpgradeAttemptToVersion = null, IEnumerable protectedDisks = null, string isLastUpgradeSuccessful = null, bool? isAgentRegistrationSuccessfulAfterFailover = null, InMageRcmMobilityAgentDetails mobilityAgentDetails = null, IEnumerable lastAgentUpgradeErrorDetails = null, IEnumerable agentUpgradeBlockingErrorDetails = null, IEnumerable vmNics = null, InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails = null) + public static InMageRcmReplicationDetails InMageRcmReplicationDetails(string internalIdentifier = null, string fabricDiscoveryMachineId = null, string multiVmGroupName = null, string discoveryType = null, Guid? processServerId = null, int? processorCoreCount = null, double? allocatedMemoryInMB = null, string processServerName = null, string runAsAccountId = null, string osType = null, string firmwareType = null, IPAddress primaryNicIPAddress = null, string targetGeneration = null, string licenseType = null, LinuxLicenseType? linuxLicenseType = null, ResourceIdentifier storageAccountId = null, string targetVmName = null, string targetVmSize = null, ResourceIdentifier targetResourceGroupId = null, string targetLocation = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, ResourceIdentifier failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, long? lastRpoInSeconds = null, DateTimeOffset? lastRpoCalculatedOn = null, ResourceIdentifier lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, long? initialReplicationProcessedBytes = null, long? initialReplicationTransferredBytes = null, VmReplicationProgressHealth? initialReplicationProgressHealth = null, int? resyncProgressPercentage = null, long? resyncProcessedBytes = null, long? resyncTransferredBytes = null, VmReplicationProgressHealth? resyncProgressHealth = null, string resyncRequired = null, SiteRecoveryResyncState? resyncState = null, MobilityAgentUpgradeState? agentUpgradeState = null, string lastAgentUpgradeType = null, string agentUpgradeJobId = null, string agentUpgradeAttemptToVersion = null, IEnumerable protectedDisks = null, IEnumerable unprotectedDisks = null, string isLastUpgradeSuccessful = null, bool? isAgentRegistrationSuccessfulAfterFailover = null, InMageRcmMobilityAgentDetails mobilityAgentDetails = null, IEnumerable lastAgentUpgradeErrorDetails = null, IEnumerable agentUpgradeBlockingErrorDetails = null, IEnumerable vmNics = null, InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails = null, IEnumerable targetVmTags = null, IEnumerable seedManagedDiskTags = null, IEnumerable targetManagedDiskTags = null, IEnumerable targetNicTags = null, string sqlServerLicenseType = null, IEnumerable supportedOSVersions = null, string osName = null, SecurityProfileProperties targetVmSecurityProfile = null) { protectedDisks ??= new List(); + unprotectedDisks ??= new List(); lastAgentUpgradeErrorDetails ??= new List(); agentUpgradeBlockingErrorDetails ??= new List(); vmNics ??= new List(); + targetVmTags ??= new List(); + seedManagedDiskTags ??= new List(); + targetManagedDiskTags ??= new List(); + targetNicTags ??= new List(); + supportedOSVersions ??= new List(); return new InMageRcmReplicationDetails( "InMageRcm", @@ -4858,6 +5044,7 @@ public static InMageRcmReplicationDetails InMageRcmReplicationDetails(string int primaryNicIPAddress, targetGeneration, licenseType, + linuxLicenseType, storageAccountId, targetVmName, targetVmSize, @@ -4889,13 +5076,22 @@ public static InMageRcmReplicationDetails InMageRcmReplicationDetails(string int agentUpgradeJobId, agentUpgradeAttemptToVersion, protectedDisks?.ToList(), + unprotectedDisks?.ToList(), isLastUpgradeSuccessful, isAgentRegistrationSuccessfulAfterFailover, mobilityAgentDetails, lastAgentUpgradeErrorDetails?.ToList(), agentUpgradeBlockingErrorDetails?.ToList(), vmNics?.ToList(), - discoveredVmDetails); + discoveredVmDetails, + targetVmTags?.ToList(), + seedManagedDiskTags?.ToList(), + targetManagedDiskTags?.ToList(), + targetNicTags?.ToList(), + sqlServerLicenseType, + supportedOSVersions?.ToList(), + osName, + targetVmSecurityProfile); } /// Initializes a new instance of . @@ -4918,10 +5114,11 @@ public static InMageRcmReprotectContent InMageRcmReprotectContent(string reprote /// Initializes a new instance of . /// A value indicating whether VM is to be shutdown. /// The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. + /// A value indicating the inplace OS Upgrade version. /// A new instance for mocking. - public static InMageRcmUnplannedFailoverContent InMageRcmUnplannedFailoverContent(string performShutdown = null, ResourceIdentifier recoveryPointId = null) + public static InMageRcmUnplannedFailoverContent InMageRcmUnplannedFailoverContent(string performShutdown = null, ResourceIdentifier recoveryPointId = null, string osUpgradeVersion = null) { - return new InMageRcmUnplannedFailoverContent("InMageRcm", serializedAdditionalRawData: null, performShutdown, recoveryPointId); + return new InMageRcmUnplannedFailoverContent("InMageRcm", serializedAdditionalRawData: null, performShutdown, recoveryPointId, osUpgradeVersion); } /// Initializes a new instance of . @@ -5491,8 +5688,12 @@ public static VMwareCbtContainerMappingContent VMwareCbtContainerMappingContent( /// The log storage account ARM Id. /// The key vault secret name of the log storage account. /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId = null, SiteRecoveryDiskAccountType? diskType = null, string isOSDisk = null, ResourceIdentifier logStorageAccountId = null, string logStorageAccountSasSecretName = null, ResourceIdentifier diskEncryptionSetId = null) + public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId = null, SiteRecoveryDiskAccountType? diskType = null, string isOSDisk = null, ResourceIdentifier logStorageAccountId = null, string logStorageAccountSasSecretName = null, ResourceIdentifier diskEncryptionSetId = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { return new VMwareCbtDiskContent( diskId, @@ -5501,6 +5702,10 @@ public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId = null, Si logStorageAccountId, logStorageAccountSasSecretName, diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData: null); } @@ -5509,6 +5714,7 @@ public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId = null, Si /// The disks to include list. /// License type. /// The SQL Server license type. + /// The license type for Linux VM's. /// A value indicating whether bulk SQL RP registration to be done. /// The data mover run as account Id. /// The snapshot run as account Id. @@ -5530,8 +5736,9 @@ public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId = null, Si /// The tags for the seed disks. /// The tags for the target disks. /// The tags for the target NICs. + /// The OS name selected by user. /// A new instance for mocking. - public static VMwareCbtEnableMigrationContent VMwareCbtEnableMigrationContent(ResourceIdentifier vmwareMachineId = null, IEnumerable disksToInclude = null, SiteRecoveryLicenseType? licenseType = null, SiteRecoverySqlServerLicenseType? sqlServerLicenseType = null, string performSqlBulkRegistration = null, ResourceIdentifier dataMoverRunAsAccountId = null, ResourceIdentifier snapshotRunAsAccountId = null, string targetVmName = null, string targetVmSize = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, string targetSubnetName = null, string testSubnetName = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier confidentialVmKeyVaultId = null, VMwareCbtSecurityProfileProperties targetVmSecurityProfile = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, string performAutoResync = null, IDictionary targetVmTags = null, IDictionary seedDiskTags = null, IDictionary targetDiskTags = null, IDictionary targetNicTags = null) + public static VMwareCbtEnableMigrationContent VMwareCbtEnableMigrationContent(ResourceIdentifier vmwareMachineId = null, IEnumerable disksToInclude = null, SiteRecoveryLicenseType? licenseType = null, SiteRecoverySqlServerLicenseType? sqlServerLicenseType = null, LinuxLicenseType? linuxLicenseType = null, string performSqlBulkRegistration = null, ResourceIdentifier dataMoverRunAsAccountId = null, ResourceIdentifier snapshotRunAsAccountId = null, string targetVmName = null, string targetVmSize = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, string targetSubnetName = null, string testSubnetName = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier confidentialVmKeyVaultId = null, VMwareCbtSecurityProfileProperties targetVmSecurityProfile = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, string performAutoResync = null, IDictionary targetVmTags = null, IDictionary seedDiskTags = null, IDictionary targetDiskTags = null, IDictionary targetNicTags = null, string userSelectedOSName = null) { disksToInclude ??= new List(); targetVmTags ??= new Dictionary(); @@ -5546,6 +5753,7 @@ public static VMwareCbtEnableMigrationContent VMwareCbtEnableMigrationContent(Re disksToInclude?.ToList(), licenseType, sqlServerLicenseType, + linuxLicenseType, performSqlBulkRegistration, dataMoverRunAsAccountId, snapshotRunAsAccountId, @@ -5566,7 +5774,8 @@ public static VMwareCbtEnableMigrationContent VMwareCbtEnableMigrationContent(Re targetVmTags, seedDiskTags, targetDiskTags, - targetNicTags); + targetNicTags, + userSelectedOSName); } /// Initializes a new instance of . @@ -5580,10 +5789,13 @@ public static VMwareCbtEventDetails VMwareCbtEventDetails(string migrationItemNa /// Initializes a new instance of . /// A value indicating whether VM is to be shutdown. /// A value indicating the inplace OS Upgrade version. + /// The managed run command script input. /// A new instance for mocking. - public static VMwareCbtMigrateContent VMwareCbtMigrateContent(string performShutdown = null, string osUpgradeVersion = null) + public static VMwareCbtMigrateContent VMwareCbtMigrateContent(string performShutdown = null, string osUpgradeVersion = null, IEnumerable postMigrationSteps = null) { - return new VMwareCbtMigrateContent("VMwareCbt", serializedAdditionalRawData: null, performShutdown, osUpgradeVersion); + postMigrationSteps ??= new List(); + + return new VMwareCbtMigrateContent("VMwareCbt", serializedAdditionalRawData: null, performShutdown, osUpgradeVersion, postMigrationSteps?.ToList()); } /// Initializes a new instance of . @@ -5594,6 +5806,7 @@ public static VMwareCbtMigrateContent VMwareCbtMigrateContent(string performShut /// The target generation. /// License Type of the VM to be used. /// The SQL Server license type. + /// The license type for Linux VM's. /// The data mover run as account Id. /// The snapshot run as account Id. /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. @@ -5636,7 +5849,7 @@ public static VMwareCbtMigrateContent VMwareCbtMigrateContent(string performShut /// A value indicating the gateway operation details. /// A value indicating the SRS operation name. /// A new instance for mocking. - public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId = null, string osType = null, string osName = null, string firmwareType = null, string targetGeneration = null, string licenseType = null, string sqlServerLicenseType = null, ResourceIdentifier dataMoverRunAsAccountId = null, ResourceIdentifier snapshotRunAsAccountId = null, ResourceIdentifier storageAccountId = null, string targetVmName = null, string targetVmSize = null, string targetLocation = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier confidentialVmKeyVaultId = null, VMwareCbtSecurityProfileProperties targetVmSecurityProfile = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, IReadOnlyDictionary targetVmTags = null, IEnumerable protectedDisks = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, IEnumerable vmNics = null, IReadOnlyDictionary targetNicTags = null, ResourceIdentifier migrationRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, ResourceIdentifier lastRecoveryPointId = null, int? initialSeedingProgressPercentage = null, int? migrationProgressPercentage = null, int? resyncProgressPercentage = null, int? resumeProgressPercentage = null, int? deltaSyncProgressPercentage = null, string isCheckSumResyncCycle = null, long? initialSeedingRetryCount = null, long? resyncRetryCount = null, long? resumeRetryCount = null, long? deltaSyncRetryCount = null, string resyncRequired = null, SiteRecoveryResyncState? resyncState = null, string performAutoResync = null, IReadOnlyDictionary seedDiskTags = null, IReadOnlyDictionary targetDiskTags = null, IEnumerable supportedOSVersions = null, ApplianceMonitoringDetails applianceMonitoringDetails = null, GatewayOperationDetails gatewayOperationDetails = null, string operationName = null) + public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId = null, string osType = null, string osName = null, string firmwareType = null, string targetGeneration = null, string licenseType = null, string sqlServerLicenseType = null, LinuxLicenseType? linuxLicenseType = null, ResourceIdentifier dataMoverRunAsAccountId = null, ResourceIdentifier snapshotRunAsAccountId = null, ResourceIdentifier storageAccountId = null, string targetVmName = null, string targetVmSize = null, string targetLocation = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier targetAvailabilitySetId = null, string targetAvailabilityZone = null, ResourceIdentifier targetProximityPlacementGroupId = null, ResourceIdentifier confidentialVmKeyVaultId = null, VMwareCbtSecurityProfileProperties targetVmSecurityProfile = null, ResourceIdentifier targetBootDiagnosticsStorageAccountId = null, IReadOnlyDictionary targetVmTags = null, IEnumerable protectedDisks = null, ResourceIdentifier targetNetworkId = null, ResourceIdentifier testNetworkId = null, IEnumerable vmNics = null, IReadOnlyDictionary targetNicTags = null, ResourceIdentifier migrationRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, ResourceIdentifier lastRecoveryPointId = null, int? initialSeedingProgressPercentage = null, int? migrationProgressPercentage = null, int? resyncProgressPercentage = null, int? resumeProgressPercentage = null, int? deltaSyncProgressPercentage = null, string isCheckSumResyncCycle = null, long? initialSeedingRetryCount = null, long? resyncRetryCount = null, long? resumeRetryCount = null, long? deltaSyncRetryCount = null, string resyncRequired = null, SiteRecoveryResyncState? resyncState = null, string performAutoResync = null, IReadOnlyDictionary seedDiskTags = null, IReadOnlyDictionary targetDiskTags = null, IEnumerable supportedOSVersions = null, ApplianceMonitoringDetails applianceMonitoringDetails = null, GatewayOperationDetails gatewayOperationDetails = null, string operationName = null) { targetVmTags ??= new Dictionary(); protectedDisks ??= new List(); @@ -5656,6 +5869,7 @@ public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdenti targetGeneration, licenseType, sqlServerLicenseType, + linuxLicenseType, dataMoverRunAsAccountId, snapshotRunAsAccountId, storageAccountId, @@ -5715,8 +5929,12 @@ public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdenti /// The uri of the target blob. /// The name for the target managed disk. /// A value indicating the gateway operation details. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId = null, string diskName = null, SiteRecoveryDiskAccountType? diskType = null, string diskPath = null, string isOSDisk = null, long? capacityInBytes = null, ResourceIdentifier logStorageAccountId = null, string logStorageAccountSasSecretName = null, ResourceIdentifier diskEncryptionSetId = null, string seedManagedDiskId = null, Uri seedBlobUri = null, string targetManagedDiskId = null, Uri targetBlobUri = null, string targetDiskName = null, GatewayOperationDetails gatewayOperationDetails = null) + public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId = null, string diskName = null, SiteRecoveryDiskAccountType? diskType = null, string diskPath = null, string isOSDisk = null, long? capacityInBytes = null, ResourceIdentifier logStorageAccountId = null, string logStorageAccountSasSecretName = null, ResourceIdentifier diskEncryptionSetId = null, string seedManagedDiskId = null, Uri seedBlobUri = null, string targetManagedDiskId = null, Uri targetBlobUri = null, string targetDiskName = null, GatewayOperationDetails gatewayOperationDetails = null, int? sectorSizeInBytes = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { return new VMwareCbtProtectedDiskDetails( diskId, @@ -5734,6 +5952,10 @@ public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string targetBlobUri, targetDiskName, gatewayOperationDetails, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData: null); } @@ -5848,10 +6070,12 @@ public static VMwareCbtResyncContent VMwareCbtResyncContent(string skipCbtReset /// The test network Id. /// The list of NIC details. /// A value indicating the inplace OS Upgrade version. + /// The managed run command script input. /// A new instance for mocking. - public static VMwareCbtTestMigrateContent VMwareCbtTestMigrateContent(ResourceIdentifier recoveryPointId = null, ResourceIdentifier networkId = null, IEnumerable vmNics = null, string osUpgradeVersion = null) + public static VMwareCbtTestMigrateContent VMwareCbtTestMigrateContent(ResourceIdentifier recoveryPointId = null, ResourceIdentifier networkId = null, IEnumerable vmNics = null, string osUpgradeVersion = null, IEnumerable postMigrationSteps = null) { vmNics ??= new List(); + postMigrationSteps ??= new List(); return new VMwareCbtTestMigrateContent( "VMwareCbt", @@ -5859,17 +6083,28 @@ public static VMwareCbtTestMigrateContent VMwareCbtTestMigrateContent(ResourceId recoveryPointId, networkId, vmNics?.ToList(), - osUpgradeVersion); + osUpgradeVersion, + postMigrationSteps?.ToList()); } /// Initializes a new instance of . /// The disk Id. /// The target disk name. /// A value indicating whether the disk is the OS disk. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// A new instance for mocking. - public static VMwareCbtUpdateDiskContent VMwareCbtUpdateDiskContent(string diskId = null, string targetDiskName = null, string isOSDisk = null) + public static VMwareCbtUpdateDiskContent VMwareCbtUpdateDiskContent(string diskId = null, string targetDiskName = null, string isOSDisk = null, long? iops = null, long? throughputInMbps = null, long? diskSizeInGB = null) { - return new VMwareCbtUpdateDiskContent(diskId, targetDiskName, isOSDisk, serializedAdditionalRawData: null); + return new VMwareCbtUpdateDiskContent( + diskId, + targetDiskName, + isOSDisk, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -6019,6 +6254,510 @@ public static VMwareVmDetails VMwareVmDetails(string agentGeneratedId = null, st validationErrors?.ToList()); } + /// Initializes a new instance of . + /// The fabric specific object Id of the virtual machine. + /// The recovery container Id. + /// The recovery resource group Id. Valid for V2 scenarios. + /// The recovery cloud service Id. Valid for V1 scenarios. + /// The recovery availability set Id. + /// The recovery proximity placement group Id. + /// The list of vm disk details. + /// The list of vm managed disk details. + /// The multi vm group name. + /// The multi vm group id. + /// The boot diagnostic storage account. + /// The recovery disk encryption information (for two pass flows). + /// The recovery availability zone. + /// The recovery extended location. + /// The recovery Azure virtual network ARM id. + /// The recovery subnet name. + /// The virtual machine scale set Id. + /// The recovery capacity reservation group Id. + /// A value indicating whether the auto protection is enabled. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static A2AEnableProtectionContent A2AEnableProtectionContent(ResourceIdentifier fabricObjectId, ResourceIdentifier recoveryContainerId, ResourceIdentifier recoveryResourceGroupId, string recoveryCloudServiceId, ResourceIdentifier recoveryAvailabilitySetId, ResourceIdentifier recoveryProximityPlacementGroupId, IEnumerable vmDisks, IEnumerable vmManagedDisks, string multiVmGroupName, string multiVmGroupId, ResourceIdentifier recoveryBootDiagStorageAccountId, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation recoveryExtendedLocation, ResourceIdentifier recoveryAzureNetworkId, string recoverySubnetName, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk) + { + return A2AEnableProtectionContent(fabricObjectId: fabricObjectId, recoveryContainerId: recoveryContainerId, recoveryResourceGroupId: recoveryResourceGroupId, recoveryCloudServiceId: recoveryCloudServiceId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, recoveryProximityPlacementGroupId: recoveryProximityPlacementGroupId, vmDisks: vmDisks, vmManagedDisks: vmManagedDisks, multiVmGroupName: multiVmGroupName, multiVmGroupId: multiVmGroupId, protectionClusterId: default, recoveryBootDiagStorageAccountId: recoveryBootDiagStorageAccountId, diskEncryptionInfo: diskEncryptionInfo, recoveryAvailabilityZone: recoveryAvailabilityZone, recoveryExtendedLocation: recoveryExtendedLocation, recoveryAzureNetworkId: recoveryAzureNetworkId, recoverySubnetName: recoverySubnetName, recoveryVirtualMachineScaleSetId: recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId: recoveryCapacityReservationGroupId, autoProtectionOfDataDisk: autoProtectionOfDataDisk); + } + + /// Initializes a new instance of . + /// The fabric specific object Id of the virtual machine. + /// The initial primary availability zone. + /// The initial primary fabric location. + /// The initial recovery availability zone. + /// The initial primary extended location. + /// The initial recovery extended location. + /// The initial recovery fabric location. + /// The multi vm group Id. + /// The multi vm group name. + /// Whether Multi VM group is auto created or specified by user. + /// The management Id. + /// The list of protected disks. + /// The list of unprotected disks. + /// The list of protected managed disks. + /// The recovery boot diagnostic storage account Arm Id. + /// Primary fabric location. + /// The recovery fabric location. + /// The type of operating system. + /// The size of recovery virtual machine. + /// The name of recovery virtual machine. + /// The recovery resource group. + /// The recovery cloud service. + /// The recovery availability set. + /// The recovery virtual network. + /// The test failover virtual network. + /// The virtual machine nic details. + /// The synced configuration details. + /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + /// The last heartbeat received from the source server. + /// The agent version. + /// Agent expiry date. + /// A value indicating whether replication agent update is required. + /// Agent certificate expiry date. + /// A value indicating whether agent certificate update is required. + /// The recovery fabric object Id. + /// The protection state for the vm. + /// The protection state description for the vm. + /// An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. + /// The test failover fabric object Id. + /// The last RPO value in seconds. + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + /// The primary availability zone. + /// The recovery availability zone. + /// The primary Extended Location. + /// The recovery Extended Location. + /// The encryption type of the VM. + /// The test failover vm name. + /// The recovery azure generation. + /// The recovery proximity placement group Id. + /// A value indicating whether the auto protection is enabled. + /// The recovery virtual machine scale set id. + /// The recovery capacity reservation group Id. + /// A value indicating the churn option selected by user. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, IEnumerable protectedDisks, IEnumerable unprotectedDisks, IEnumerable protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IEnumerable vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, ChurnOptionSelected? churnOptionSelected) + { + return A2AReplicationDetails(fabricObjectId: fabricObjectId, initialPrimaryZone: initialPrimaryZone, initialPrimaryFabricLocation: initialPrimaryFabricLocation, initialRecoveryZone: initialRecoveryZone, initialPrimaryExtendedLocation: initialPrimaryExtendedLocation, initialRecoveryExtendedLocation: initialRecoveryExtendedLocation, initialRecoveryFabricLocation: initialRecoveryFabricLocation, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName, multiVmGroupCreateOption: multiVmGroupCreateOption, managementId: managementId, protectionClusterId: default, isClusterInfraReady: default, protectedDisks: protectedDisks, unprotectedDisks: unprotectedDisks, protectedManagedDisks: protectedManagedDisks, recoveryBootDiagStorageAccountId: recoveryBootDiagStorageAccountId, primaryFabricLocation: primaryFabricLocation, recoveryFabricLocation: recoveryFabricLocation, osType: osType, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryCloudService: recoveryCloudService, recoveryAvailabilitySet: recoveryAvailabilitySet, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId: selectedTfoAzureNetworkId, vmNics: vmNics, vmSyncedConfigDetails: vmSyncedConfigDetails, monitoringPercentageCompletion: monitoringPercentageCompletion, monitoringJobType: monitoringJobType, lastHeartbeat: lastHeartbeat, agentVersion: agentVersion, agentExpireOn: agentExpireOn, isReplicationAgentUpdateRequired: isReplicationAgentUpdateRequired, agentCertificateExpireOn: agentCertificateExpireOn, isReplicationAgentCertificateUpdateRequired: isReplicationAgentCertificateUpdateRequired, recoveryFabricObjectId: recoveryFabricObjectId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, lifecycleId: lifecycleId, testFailoverRecoveryFabricObjectId: testFailoverRecoveryFabricObjectId, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, primaryAvailabilityZone: primaryAvailabilityZone, recoveryAvailabilityZone: recoveryAvailabilityZone, primaryExtendedLocation: primaryExtendedLocation, recoveryExtendedLocation: recoveryExtendedLocation, vmEncryptionType: vmEncryptionType, tfoAzureVmName: tfoAzureVmName, recoveryAzureGeneration: recoveryAzureGeneration, recoveryProximityPlacementGroupId: recoveryProximityPlacementGroupId, autoProtectionOfDataDisk: autoProtectionOfDataDisk, recoveryVirtualMachineScaleSetId: recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId: recoveryCapacityReservationGroupId, churnOptionSelected: churnOptionSelected); + } + + /// Initializes a new instance of . + /// The disk Id. + /// Seed managed disk Id. + /// The replica disk type. + /// The disk encryption set ARM Id. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HyperVReplicaAzureManagedDiskDetails HyperVReplicaAzureManagedDiskDetails(string diskId, string seedManagedDiskId, string replicaDiskType, ResourceIdentifier diskEncryptionSetId) + { + return HyperVReplicaAzureManagedDiskDetails(diskId: diskId, seedManagedDiskId: seedManagedDiskId, replicaDiskType: replicaDiskType, diskEncryptionSetId: diskEncryptionSetId, targetDiskAccountType: default, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// Azure VM Disk details. + /// Recovery Azure given name. + /// The Recovery Azure VM size. + /// The recovery Azure storage account. + /// The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. + /// The Last replication time. + /// Last RPO value. + /// The last RPO calculated time. + /// The virtual machine Id. + /// The protection state for the vm. + /// The protection state description for the vm. + /// Initial replication details. + /// The PE Network details. + /// The selected recovery azure network Id. + /// The selected source nic Id which will be used as the primary nic during failover. + /// The encryption info. + /// The operating system info. + /// The RAM size of the VM on the primary side. + /// The CPU count of the VM on the primary side. + /// The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + /// The target resource group Id. + /// The recovery availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// A value indicating whether managed disks should be used during failover. + /// License Type of the VM to be used. + /// The SQL Server license type. + /// The last recovery point received time. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The list of protected managed disks. + /// A value indicating all available inplace OS Upgrade configurations. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable protectedManagedDisks, IEnumerable allAvailableOSUpgradeConfigurations) + { + return HyperVReplicaAzureReplicationDetails(azureVmDiskDetails: azureVmDiskDetails, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureStorageAccount: recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId: recoveryAzureLogStorageAccountId, lastReplicatedOn: lastReplicatedOn, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, vmId: vmId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, initialReplicationDetails: initialReplicationDetails, vmNics: vmNics, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedSourceNicId: selectedSourceNicId, encryption: encryption, osDetails: osDetails, sourceVmRamSizeInMB: sourceVmRamSizeInMB, sourceVmCpuCount: sourceVmCpuCount, enableRdpOnTargetOption: enableRdpOnTargetOption, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, useManagedDisks: useManagedDisks, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, linuxLicenseType: default, lastRecoveryPointReceived: lastRecoveryPointReceived, targetVmTags: targetVmTags, seedManagedDiskTags: seedManagedDiskTags, targetManagedDiskTags: targetManagedDiskTags, targetNicTags: targetNicTags, protectedManagedDisks: protectedManagedDisks, allAvailableOSUpgradeConfigurations: allAvailableOSUpgradeConfigurations, targetVmSecurityProfile: default); + } + + /// Initializes a new instance of . + /// VM Disk details. + /// Product type. + /// The OSEdition. + /// The OS Version. + /// The OS Major Version. + /// The OS Minor Version. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SiteRecoveryOSDetails SiteRecoveryOSDetails(string osType, string productType, string osEdition, string osVersion, string osMajorVersion, string osMinorVersion) + { + return SiteRecoveryOSDetails(osType: osType, productType: productType, osEdition: osEdition, osVersion: osVersion, osMajorVersion: osMajorVersion, osMinorVersion: osMinorVersion, userSelectedOSName: default); + } + + /// Initializes a new instance of . + /// The disk Id. + /// The target disk name. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static UpdateDiskContent UpdateDiskContent(string diskId, string targetDiskName) + { + return UpdateDiskContent(diskId: diskId, targetDiskName: targetDiskName, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The disk Id. + /// The log storage account ARM Id. + /// The disk type. + /// The DiskEncryptionSet ARM Id. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmDiskContent InMageRcmDiskContent(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId) + { + return InMageRcmDiskContent(diskId: diskId, logStorageAccountId: logStorageAccountId, diskType: diskType, diskEncryptionSetId: diskEncryptionSetId, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The log storage account ARM Id. + /// The disk type. + /// The DiskEncryptionSet ARM Id. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmDisksDefaultContent InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId) + { + return InMageRcmDisksDefaultContent(logStorageAccountId: logStorageAccountId, diskType: diskType, diskEncryptionSetId: diskEncryptionSetId, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The ARM Id of discovered machine. + /// The disks to include list. + /// The default disk input. + /// The target resource group ARM Id. + /// The selected target network ARM Id. + /// The selected test network ARM Id. + /// The selected target subnet name. + /// The selected test subnet name. + /// The target VM name. + /// The target VM size. + /// The license type. + /// The target availability set ARM Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// The target boot diagnostics storage account ARM Id. + /// The run-as account Id. + /// The process server Id. + /// The multi VM group name. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmEnableProtectionContent InMageRcmEnableProtectionContent(string fabricDiscoveryMachineId, IEnumerable disksToInclude, InMageRcmDisksDefaultContent disksDefault, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, string targetVmName, string targetVmSize, SiteRecoveryLicenseType? licenseType, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string runAsAccountId, Guid processServerId, string multiVmGroupName) + { + return InMageRcmEnableProtectionContent(fabricDiscoveryMachineId: fabricDiscoveryMachineId, disksToInclude: disksToInclude, disksDefault: disksDefault, targetResourceGroupId: targetResourceGroupId, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, targetSubnetName: targetSubnetName, testSubnetName: testSubnetName, targetVmName: targetVmName, targetVmSize: targetVmSize, licenseType: licenseType, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, runAsAccountId: runAsAccountId, processServerId: processServerId, multiVmGroupName: multiVmGroupName, sqlServerLicenseType: default, linuxLicenseType: default, targetVmTags: default, seedManagedDiskTags: default, targetManagedDiskTags: default, targetNicTags: default, userSelectedOSName: default, targetVmSecurityProfile: default); + } + + /// Initializes a new instance of . + /// The NIC Id. + /// A value indicating whether this is the primary NIC. + /// A value indicating whether this NIC is selected for failover. + /// The source IP address. + /// The source IP address type. + /// Source network Id. + /// Source subnet name. + /// The target IP address. + /// The target IP address type. + /// Target subnet name. + /// Test subnet name. + /// The test IP address. + /// The test IP address type. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmNicDetails InMageRcmNicDetails(string nicId, string isPrimaryNic, string isSelectedForFailover, IPAddress sourceIPAddress, SiteRecoveryEthernetAddressType? sourceIPAddressType, ResourceIdentifier sourceNetworkId, string sourceSubnetName, IPAddress targetIPAddress, SiteRecoveryEthernetAddressType? targetIPAddressType, string targetSubnetName, string testSubnetName, IPAddress testIPAddress, SiteRecoveryEthernetAddressType? testIPAddressType) + { + return InMageRcmNicDetails(nicId: nicId, isPrimaryNic: isPrimaryNic, isSelectedForFailover: isSelectedForFailover, sourceIPAddress: sourceIPAddress, sourceIPAddressType: sourceIPAddressType, sourceNetworkId: sourceNetworkId, sourceSubnetName: sourceSubnetName, targetIPAddress: targetIPAddress, targetIPAddressType: targetIPAddressType, targetSubnetName: targetSubnetName, testSubnetName: testSubnetName, testIPAddress: testIPAddress, testIPAddressType: testIPAddressType, targetNicName: default); + } + + /// Initializes a new instance of . + /// The NIC Id. + /// A value indicating whether this is the primary NIC. + /// A value indicating whether this NIC is selected for failover. + /// Target subnet name. + /// The target static IP address. + /// The test subnet name. + /// The test static IP address. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmNicContent InMageRcmNicContent(string nicId, string isPrimaryNic, string isSelectedForFailover, string targetSubnetName, IPAddress targetStaticIPAddress, string testSubnetName, IPAddress testStaticIPAddress) + { + return InMageRcmNicContent(nicId: nicId, isPrimaryNic: isPrimaryNic, isSelectedForFailover: isSelectedForFailover, targetSubnetName: targetSubnetName, targetStaticIPAddress: targetStaticIPAddress, testSubnetName: testSubnetName, testStaticIPAddress: testStaticIPAddress, targetNicName: default); + } + + /// Initializes a new instance of . + /// The disk Id. + /// The disk name. + /// A value indicating whether the disk is the OS disk. + /// The disk capacity in bytes. + /// The log storage account ARM Id. + /// The DiskEncryptionSet ARM Id. + /// The ARM Id of the seed managed disk. + /// The uri of the seed blob. + /// The ARM Id of the target managed disk. + /// The disk type. + /// The data pending in log data store in MB. + /// The data pending at source agent in MB. + /// A value indicating whether initial replication is complete or not. + /// The initial replication details. + /// The resync details. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmProtectedDiskDetails InMageRcmProtectedDiskDetails(string diskId, string diskName, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, SiteRecoveryDiskAccountType? diskType, double? dataPendingInLogDataStoreInMB, double? dataPendingAtSourceAgentInMB, string isInitialReplicationComplete, InMageRcmSyncDetails irDetails, InMageRcmSyncDetails resyncDetails) + { + return InMageRcmProtectedDiskDetails(diskId: diskId, diskName: diskName, isOSDisk: isOSDisk, capacityInBytes: capacityInBytes, diskState: default, logStorageAccountId: logStorageAccountId, diskEncryptionSetId: diskEncryptionSetId, seedManagedDiskId: seedManagedDiskId, seedBlobUri: seedBlobUri, targetManagedDiskId: targetManagedDiskId, diskType: diskType, dataPendingInLogDataStoreInMB: dataPendingInLogDataStoreInMB, dataPendingAtSourceAgentInMB: dataPendingAtSourceAgentInMB, isInitialReplicationComplete: isInitialReplicationComplete, irDetails: irDetails, resyncDetails: resyncDetails, customTargetDiskName: default, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The virtual machine internal identifier. + /// The ARM Id of the discovered VM. + /// The multi VM group name. + /// The type of the discovered VM. + /// The process server Id. + /// The processor core count. + /// The allocated memory in MB. + /// The process server name. + /// The run-as account Id. + /// The type of the OS on the VM. + /// The firmware type. + /// The IP address of the primary network interface. + /// The target generation. + /// License Type of the VM to be used. + /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + /// Target VM name. + /// The target VM size. + /// The target resource group Id. + /// The target location. + /// The target availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// The target boot diagnostics storage account ARM Id. + /// The target network Id. + /// The test network Id. + /// The recovery point Id to which the VM was failed over. + /// The last recovery point received time. + /// The last recovery point objective value. + /// The last recovery point objective calculated time. + /// The last recovery point Id. + /// The initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + /// The initial replication transferred bytes from source VM to azure for all selected disks on source VM. + /// The initial replication progress health. + /// The resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks in source VM. + /// The resync transferred bytes from source VM to azure for all selected disks on source VM. + /// The resync progress health. + /// A value indicating whether resync is required. + /// The resync state. + /// The agent auto upgrade state. + /// The last agent upgrade type. + /// The agent upgrade job Id. + /// The agent version to which last agent upgrade was attempted. + /// The list of protected disks. + /// A value indicating whether last agent upgrade was successful or not. + /// A value indicating whether agent registration was successful after failover. + /// The mobility agent information. + /// The last agent upgrade error information. + /// The agent upgrade blocking error information. + /// The network details. + /// The discovered VM details. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmReplicationDetails InMageRcmReplicationDetails(string internalIdentifier, string fabricDiscoveryMachineId, string multiVmGroupName, string discoveryType, Guid? processServerId, int? processorCoreCount, double? allocatedMemoryInMB, string processServerName, string runAsAccountId, string osType, string firmwareType, IPAddress primaryNicIPAddress, string targetGeneration, string licenseType, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, string targetLocation, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, ResourceIdentifier failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, long? lastRpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, ResourceIdentifier lastRecoveryPointId, int? initialReplicationProgressPercentage, long? initialReplicationProcessedBytes, long? initialReplicationTransferredBytes, VmReplicationProgressHealth? initialReplicationProgressHealth, int? resyncProgressPercentage, long? resyncProcessedBytes, long? resyncTransferredBytes, VmReplicationProgressHealth? resyncProgressHealth, string resyncRequired, SiteRecoveryResyncState? resyncState, MobilityAgentUpgradeState? agentUpgradeState, string lastAgentUpgradeType, string agentUpgradeJobId, string agentUpgradeAttemptToVersion, IEnumerable protectedDisks, string isLastUpgradeSuccessful, bool? isAgentRegistrationSuccessfulAfterFailover, InMageRcmMobilityAgentDetails mobilityAgentDetails, IEnumerable lastAgentUpgradeErrorDetails, IEnumerable agentUpgradeBlockingErrorDetails, IEnumerable vmNics, InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails) + { + return InMageRcmReplicationDetails(internalIdentifier: internalIdentifier, fabricDiscoveryMachineId: fabricDiscoveryMachineId, multiVmGroupName: multiVmGroupName, discoveryType: discoveryType, processServerId: processServerId, processorCoreCount: processorCoreCount, allocatedMemoryInMB: allocatedMemoryInMB, processServerName: processServerName, runAsAccountId: runAsAccountId, osType: osType, firmwareType: firmwareType, primaryNicIPAddress: primaryNicIPAddress, targetGeneration: targetGeneration, licenseType: licenseType, linuxLicenseType: default, storageAccountId: storageAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetResourceGroupId: targetResourceGroupId, targetLocation: targetLocation, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, failoverRecoveryPointId: failoverRecoveryPointId, lastRecoveryPointReceived: lastRecoveryPointReceived, lastRpoInSeconds: lastRpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, lastRecoveryPointId: lastRecoveryPointId, initialReplicationProgressPercentage: initialReplicationProgressPercentage, initialReplicationProcessedBytes: initialReplicationProcessedBytes, initialReplicationTransferredBytes: initialReplicationTransferredBytes, initialReplicationProgressHealth: initialReplicationProgressHealth, resyncProgressPercentage: resyncProgressPercentage, resyncProcessedBytes: resyncProcessedBytes, resyncTransferredBytes: resyncTransferredBytes, resyncProgressHealth: resyncProgressHealth, resyncRequired: resyncRequired, resyncState: resyncState, agentUpgradeState: agentUpgradeState, lastAgentUpgradeType: lastAgentUpgradeType, agentUpgradeJobId: agentUpgradeJobId, agentUpgradeAttemptToVersion: agentUpgradeAttemptToVersion, protectedDisks: protectedDisks, unprotectedDisks: default, isLastUpgradeSuccessful: isLastUpgradeSuccessful, isAgentRegistrationSuccessfulAfterFailover: isAgentRegistrationSuccessfulAfterFailover, mobilityAgentDetails: mobilityAgentDetails, lastAgentUpgradeErrorDetails: lastAgentUpgradeErrorDetails, agentUpgradeBlockingErrorDetails: agentUpgradeBlockingErrorDetails, vmNics: vmNics, discoveredVmDetails: discoveredVmDetails, targetVmTags: default, seedManagedDiskTags: default, targetManagedDiskTags: default, targetNicTags: default, sqlServerLicenseType: default, supportedOSVersions: default, osName: default, targetVmSecurityProfile: default); + } + + /// Initializes a new instance of . + /// A value indicating whether VM is to be shutdown. + /// The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static InMageRcmUnplannedFailoverContent InMageRcmUnplannedFailoverContent(string performShutdown, ResourceIdentifier recoveryPointId) + { + return InMageRcmUnplannedFailoverContent(performShutdown: performShutdown, recoveryPointId: recoveryPointId, osUpgradeVersion: default); + } + + /// Initializes a new instance of . + /// The disk Id. + /// The disk type. + /// A value indicating whether the disk is the OS disk. + /// The log storage account ARM Id. + /// The key vault secret name of the log storage account. + /// The DiskEncryptionSet ARM Id. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtDiskContent VMwareCbtDiskContent(string diskId, SiteRecoveryDiskAccountType? diskType, string isOSDisk, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId) + { + return VMwareCbtDiskContent(diskId: diskId, diskType: diskType, isOSDisk: isOSDisk, logStorageAccountId: logStorageAccountId, logStorageAccountSasSecretName: logStorageAccountSasSecretName, diskEncryptionSetId: diskEncryptionSetId, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The ARM Id of the VM discovered in VMware. + /// The disks to include list. + /// License type. + /// The SQL Server license type. + /// A value indicating whether bulk SQL RP registration to be done. + /// The data mover run as account Id. + /// The snapshot run as account Id. + /// The target VM name. + /// The target VM size. + /// The target resource group ARM Id. + /// The target network ARM Id. + /// The selected test network ARM Id. + /// The target subnet name. + /// The selected test subnet name. + /// The target availability set ARM Id. + /// The target availability zone. + /// The target proximity placement group ARM Id. + /// The confidential VM key vault Id for ADE installation. + /// The target VM security profile. + /// The target boot diagnostics storage account ARM Id. + /// A value indicating whether auto resync is to be done. + /// The target VM tags. + /// The tags for the seed disks. + /// The tags for the target disks. + /// The tags for the target NICs. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtEnableMigrationContent VMwareCbtEnableMigrationContent(ResourceIdentifier vmwareMachineId, IEnumerable disksToInclude, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, string performSqlBulkRegistration, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string performAutoResync, IDictionary targetVmTags, IDictionary seedDiskTags, IDictionary targetDiskTags, IDictionary targetNicTags) + { + return VMwareCbtEnableMigrationContent(vmwareMachineId: vmwareMachineId, disksToInclude: disksToInclude, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, linuxLicenseType: default, performSqlBulkRegistration: performSqlBulkRegistration, dataMoverRunAsAccountId: dataMoverRunAsAccountId, snapshotRunAsAccountId: snapshotRunAsAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetResourceGroupId: targetResourceGroupId, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, targetSubnetName: targetSubnetName, testSubnetName: testSubnetName, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, confidentialVmKeyVaultId: confidentialVmKeyVaultId, targetVmSecurityProfile: targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, performAutoResync: performAutoResync, targetVmTags: targetVmTags, seedDiskTags: seedDiskTags, targetDiskTags: targetDiskTags, targetNicTags: targetNicTags, userSelectedOSName: default); + } + + /// Initializes a new instance of . + /// A value indicating whether VM is to be shutdown. + /// A value indicating the inplace OS Upgrade version. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtMigrateContent VMwareCbtMigrateContent(string performShutdown, string osUpgradeVersion) + { + return VMwareCbtMigrateContent(performShutdown: performShutdown, osUpgradeVersion: osUpgradeVersion, postMigrationSteps: default); + } + + /// Initializes a new instance of . + /// The ARM Id of the VM discovered in VMware. + /// The type of the OS on the VM. + /// The name of the OS on the VM. + /// The firmware type. + /// The target generation. + /// License Type of the VM to be used. + /// The SQL Server license type. + /// The data mover run as account Id. + /// The snapshot run as account Id. + /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. + /// Target VM name. + /// The target VM size. + /// The target location. + /// The target resource group Id. + /// The target availability set Id. + /// The target availability zone. + /// The target proximity placement group Id. + /// The confidential VM key vault Id for ADE installation. + /// The target VM security profile. + /// The target boot diagnostics storage account ARM Id. + /// The target VM tags. + /// The list of protected disks. + /// The target network Id. + /// The test network Id. + /// The network details. + /// The tags for the target NICs. + /// The recovery point Id to which the VM was migrated. + /// The last recovery point received time. + /// The last recovery point Id. + /// The initial seeding progress percentage. + /// The migration progress percentage. + /// The resync progress percentage. + /// The resume progress percentage. + /// The delta sync progress percentage. + /// A value indicating whether checksum resync cycle is in progress. + /// The initial seeding retry count. + /// The resync retry count. + /// The resume retry count. + /// The delta sync retry count. + /// A value indicating whether resync is required. + /// The resync state. + /// A value indicating whether auto resync is to be done. + /// The tags for the seed disks. + /// The tags for the target disks. + /// A value indicating the inplace OS Upgrade version. + /// A value indicating the appliance monitoring details. + /// A value indicating the gateway operation details. + /// A value indicating the SRS operation name. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IEnumerable protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IEnumerable vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, int? deltaSyncProgressPercentage, string isCheckSumResyncCycle, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, long? deltaSyncRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IEnumerable supportedOSVersions, ApplianceMonitoringDetails applianceMonitoringDetails, GatewayOperationDetails gatewayOperationDetails, string operationName) + { + return VMwareCbtMigrationDetails(vmwareMachineId: vmwareMachineId, osType: osType, osName: osName, firmwareType: firmwareType, targetGeneration: targetGeneration, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, linuxLicenseType: default, dataMoverRunAsAccountId: dataMoverRunAsAccountId, snapshotRunAsAccountId: snapshotRunAsAccountId, storageAccountId: storageAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetLocation: targetLocation, targetResourceGroupId: targetResourceGroupId, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, confidentialVmKeyVaultId: confidentialVmKeyVaultId, targetVmSecurityProfile: targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, targetVmTags: targetVmTags, protectedDisks: protectedDisks, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, vmNics: vmNics, targetNicTags: targetNicTags, migrationRecoveryPointId: migrationRecoveryPointId, lastRecoveryPointReceived: lastRecoveryPointReceived, lastRecoveryPointId: lastRecoveryPointId, initialSeedingProgressPercentage: initialSeedingProgressPercentage, migrationProgressPercentage: migrationProgressPercentage, resyncProgressPercentage: resyncProgressPercentage, resumeProgressPercentage: resumeProgressPercentage, deltaSyncProgressPercentage: deltaSyncProgressPercentage, isCheckSumResyncCycle: isCheckSumResyncCycle, initialSeedingRetryCount: initialSeedingRetryCount, resyncRetryCount: resyncRetryCount, resumeRetryCount: resumeRetryCount, deltaSyncRetryCount: deltaSyncRetryCount, resyncRequired: resyncRequired, resyncState: resyncState, performAutoResync: performAutoResync, seedDiskTags: seedDiskTags, targetDiskTags: targetDiskTags, supportedOSVersions: supportedOSVersions, applianceMonitoringDetails: applianceMonitoringDetails, gatewayOperationDetails: gatewayOperationDetails, operationName: operationName); + } + + /// Initializes a new instance of . + /// The disk id. + /// The disk name. + /// The disk type. + /// The disk path. + /// A value indicating whether the disk is the OS disk. + /// The disk capacity in bytes. + /// The log storage account ARM Id. + /// The key vault secret name of the log storage account. + /// The DiskEncryptionSet ARM Id. + /// The ARM Id of the seed managed disk. + /// The uri of the seed blob. + /// The ARM Id of the target managed disk. + /// The uri of the target blob. + /// The name for the target managed disk. + /// A value indicating the gateway operation details. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName, GatewayOperationDetails gatewayOperationDetails) + { + return VMwareCbtProtectedDiskDetails(diskId: diskId, diskName: diskName, diskType: diskType, diskPath: diskPath, isOSDisk: isOSDisk, capacityInBytes: capacityInBytes, logStorageAccountId: logStorageAccountId, logStorageAccountSasSecretName: logStorageAccountSasSecretName, diskEncryptionSetId: diskEncryptionSetId, seedManagedDiskId: seedManagedDiskId, seedBlobUri: seedBlobUri, targetManagedDiskId: targetManagedDiskId, targetBlobUri: targetBlobUri, targetDiskName: targetDiskName, gatewayOperationDetails: gatewayOperationDetails, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + + /// Initializes a new instance of . + /// The recovery point Id. + /// The test network Id. + /// The list of NIC details. + /// A value indicating the inplace OS Upgrade version. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtTestMigrateContent VMwareCbtTestMigrateContent(ResourceIdentifier recoveryPointId, ResourceIdentifier networkId, IEnumerable vmNics, string osUpgradeVersion) + { + return VMwareCbtTestMigrateContent(recoveryPointId: recoveryPointId, networkId: networkId, vmNics: vmNics, osUpgradeVersion: osUpgradeVersion, postMigrationSteps: default); + } + + /// Initializes a new instance of . + /// The disk Id. + /// The target disk name. + /// A value indicating whether the disk is the OS disk. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VMwareCbtUpdateDiskContent VMwareCbtUpdateDiskContent(string diskId, string targetDiskName, string isOSDisk) + { + return VMwareCbtUpdateDiskContent(diskId: diskId, targetDiskName: targetDiskName, isOSDisk: isOSDisk, iops: default, throughputInMbps: default, diskSizeInGB: default); + } + /// Initializes a new instance of A2AReplicationDetails. /// The fabric specific object Id of the virtual machine. /// The initial primary availability zone. @@ -6077,7 +6816,7 @@ public static VMwareVmDetails VMwareVmDetails(string agentGeneratedId = null, st [EditorBrowsable(EditorBrowsableState.Never)] public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, IEnumerable protectedDisks, IEnumerable unprotectedDisks, IEnumerable protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IEnumerable vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId) { - return A2AReplicationDetails(fabricObjectId: fabricObjectId, initialPrimaryZone: initialPrimaryZone, initialPrimaryFabricLocation: initialPrimaryFabricLocation, initialRecoveryZone: initialRecoveryZone, initialPrimaryExtendedLocation: initialPrimaryExtendedLocation, initialRecoveryExtendedLocation: initialRecoveryExtendedLocation, initialRecoveryFabricLocation: initialRecoveryFabricLocation, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName, multiVmGroupCreateOption: multiVmGroupCreateOption, managementId: managementId, protectedDisks: protectedDisks, unprotectedDisks: unprotectedDisks, protectedManagedDisks: protectedManagedDisks, recoveryBootDiagStorageAccountId: recoveryBootDiagStorageAccountId, primaryFabricLocation: primaryFabricLocation, recoveryFabricLocation: recoveryFabricLocation, osType: osType, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryCloudService: recoveryCloudService, recoveryAvailabilitySet: recoveryAvailabilitySet, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId: selectedTfoAzureNetworkId, vmNics: vmNics, vmSyncedConfigDetails: vmSyncedConfigDetails, monitoringPercentageCompletion: monitoringPercentageCompletion, monitoringJobType: monitoringJobType, lastHeartbeat: lastHeartbeat, agentVersion: agentVersion, agentExpireOn: agentExpireOn, isReplicationAgentUpdateRequired: isReplicationAgentUpdateRequired, agentCertificateExpireOn: agentCertificateExpireOn, isReplicationAgentCertificateUpdateRequired: isReplicationAgentCertificateUpdateRequired, recoveryFabricObjectId: recoveryFabricObjectId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, lifecycleId: lifecycleId, testFailoverRecoveryFabricObjectId: testFailoverRecoveryFabricObjectId, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, primaryAvailabilityZone: primaryAvailabilityZone, recoveryAvailabilityZone: recoveryAvailabilityZone, primaryExtendedLocation: primaryExtendedLocation, recoveryExtendedLocation: recoveryExtendedLocation, vmEncryptionType: vmEncryptionType, tfoAzureVmName: tfoAzureVmName, recoveryAzureGeneration: recoveryAzureGeneration, recoveryProximityPlacementGroupId: recoveryProximityPlacementGroupId, autoProtectionOfDataDisk: autoProtectionOfDataDisk, recoveryVirtualMachineScaleSetId: recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId: recoveryCapacityReservationGroupId, churnOptionSelected: default); + return A2AReplicationDetails(fabricObjectId: fabricObjectId, initialPrimaryZone: initialPrimaryZone, initialPrimaryFabricLocation: initialPrimaryFabricLocation, initialRecoveryZone: initialRecoveryZone, initialPrimaryExtendedLocation: initialPrimaryExtendedLocation, initialRecoveryExtendedLocation: initialRecoveryExtendedLocation, initialRecoveryFabricLocation: initialRecoveryFabricLocation, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName, multiVmGroupCreateOption: multiVmGroupCreateOption, managementId: managementId, protectionClusterId: default, isClusterInfraReady: default, protectedDisks: protectedDisks, unprotectedDisks: unprotectedDisks, protectedManagedDisks: protectedManagedDisks, recoveryBootDiagStorageAccountId: recoveryBootDiagStorageAccountId, primaryFabricLocation: primaryFabricLocation, recoveryFabricLocation: recoveryFabricLocation, osType: osType, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryCloudService: recoveryCloudService, recoveryAvailabilitySet: recoveryAvailabilitySet, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedTfoAzureNetworkId: selectedTfoAzureNetworkId, vmNics: vmNics, vmSyncedConfigDetails: vmSyncedConfigDetails, monitoringPercentageCompletion: monitoringPercentageCompletion, monitoringJobType: monitoringJobType, lastHeartbeat: lastHeartbeat, agentVersion: agentVersion, agentExpireOn: agentExpireOn, isReplicationAgentUpdateRequired: isReplicationAgentUpdateRequired, agentCertificateExpireOn: agentCertificateExpireOn, isReplicationAgentCertificateUpdateRequired: isReplicationAgentCertificateUpdateRequired, recoveryFabricObjectId: recoveryFabricObjectId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, lifecycleId: lifecycleId, testFailoverRecoveryFabricObjectId: testFailoverRecoveryFabricObjectId, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, primaryAvailabilityZone: primaryAvailabilityZone, recoveryAvailabilityZone: recoveryAvailabilityZone, primaryExtendedLocation: primaryExtendedLocation, recoveryExtendedLocation: recoveryExtendedLocation, vmEncryptionType: vmEncryptionType, tfoAzureVmName: tfoAzureVmName, recoveryAzureGeneration: recoveryAzureGeneration, recoveryProximityPlacementGroupId: recoveryProximityPlacementGroupId, autoProtectionOfDataDisk: autoProtectionOfDataDisk, recoveryVirtualMachineScaleSetId: recoveryVirtualMachineScaleSetId, recoveryCapacityReservationGroupId: recoveryCapacityReservationGroupId, churnOptionSelected: default); } /// Initializes a new instance of HyperVReplicaAzureReplicationDetails. @@ -6118,7 +6857,7 @@ public static A2AReplicationDetails A2AReplicationDetails(ResourceIdentifier fab [EditorBrowsable(EditorBrowsableState.Never)] public static HyperVReplicaAzureReplicationDetails HyperVReplicaAzureReplicationDetails(IEnumerable azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IEnumerable vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IEnumerable protectedManagedDisks) { - return HyperVReplicaAzureReplicationDetails(azureVmDiskDetails: azureVmDiskDetails, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureStorageAccount: recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId: recoveryAzureLogStorageAccountId, lastReplicatedOn: lastReplicatedOn, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, vmId: vmId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, initialReplicationDetails: initialReplicationDetails, vmNics: vmNics, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedSourceNicId: selectedSourceNicId, encryption: encryption, osDetails: osDetails, sourceVmRamSizeInMB: sourceVmRamSizeInMB, sourceVmCpuCount: sourceVmCpuCount, enableRdpOnTargetOption: enableRdpOnTargetOption, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, useManagedDisks: useManagedDisks, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, lastRecoveryPointReceived: lastRecoveryPointReceived, targetVmTags: targetVmTags, seedManagedDiskTags: seedManagedDiskTags, targetManagedDiskTags: targetManagedDiskTags, targetNicTags: targetNicTags, protectedManagedDisks: protectedManagedDisks, allAvailableOSUpgradeConfigurations: default); + return HyperVReplicaAzureReplicationDetails(azureVmDiskDetails: azureVmDiskDetails, recoveryAzureVmName: recoveryAzureVmName, recoveryAzureVmSize: recoveryAzureVmSize, recoveryAzureStorageAccount: recoveryAzureStorageAccount, recoveryAzureLogStorageAccountId: recoveryAzureLogStorageAccountId, lastReplicatedOn: lastReplicatedOn, rpoInSeconds: rpoInSeconds, lastRpoCalculatedOn: lastRpoCalculatedOn, vmId: vmId, vmProtectionState: vmProtectionState, vmProtectionStateDescription: vmProtectionStateDescription, initialReplicationDetails: initialReplicationDetails, vmNics: vmNics, selectedRecoveryAzureNetworkId: selectedRecoveryAzureNetworkId, selectedSourceNicId: selectedSourceNicId, encryption: encryption, osDetails: osDetails, sourceVmRamSizeInMB: sourceVmRamSizeInMB, sourceVmCpuCount: sourceVmCpuCount, enableRdpOnTargetOption: enableRdpOnTargetOption, recoveryAzureResourceGroupId: recoveryAzureResourceGroupId, recoveryAvailabilitySetId: recoveryAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, useManagedDisks: useManagedDisks, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, linuxLicenseType: default, lastRecoveryPointReceived: lastRecoveryPointReceived, targetVmTags: targetVmTags, seedManagedDiskTags: seedManagedDiskTags, targetManagedDiskTags: targetManagedDiskTags, targetNicTags: targetNicTags, protectedManagedDisks: protectedManagedDisks, allAvailableOSUpgradeConfigurations: default, targetVmSecurityProfile: default); } /// Initializes a new instance of InMageAzureV2ReplicationDetails. @@ -6243,7 +6982,7 @@ public static InMageAzureV2ReplicationDetails InMageAzureV2ReplicationDetails(st [EditorBrowsable(EditorBrowsableState.Never)] public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IEnumerable protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IEnumerable vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IEnumerable supportedOSVersions) { - return VMwareCbtMigrationDetails(vmwareMachineId: vmwareMachineId, osType: osType, osName: osName, firmwareType: firmwareType, targetGeneration: targetGeneration, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, dataMoverRunAsAccountId: dataMoverRunAsAccountId, snapshotRunAsAccountId: snapshotRunAsAccountId, storageAccountId: storageAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetLocation: targetLocation, targetResourceGroupId: targetResourceGroupId, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, confidentialVmKeyVaultId: confidentialVmKeyVaultId, targetVmSecurityProfile: targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, targetVmTags: targetVmTags, protectedDisks: protectedDisks, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, vmNics: vmNics, targetNicTags: targetNicTags, migrationRecoveryPointId: migrationRecoveryPointId, lastRecoveryPointReceived: lastRecoveryPointReceived, lastRecoveryPointId: lastRecoveryPointId, initialSeedingProgressPercentage: initialSeedingProgressPercentage, migrationProgressPercentage: migrationProgressPercentage, resyncProgressPercentage: resyncProgressPercentage, resumeProgressPercentage: resumeProgressPercentage, deltaSyncProgressPercentage: default, isCheckSumResyncCycle: default, initialSeedingRetryCount: initialSeedingRetryCount, resyncRetryCount: resyncRetryCount, resumeRetryCount: resumeRetryCount, deltaSyncRetryCount: default, resyncRequired: resyncRequired, resyncState: resyncState, performAutoResync: performAutoResync, seedDiskTags: seedDiskTags, targetDiskTags: targetDiskTags, supportedOSVersions: supportedOSVersions, applianceMonitoringDetails: default, gatewayOperationDetails: default, operationName: default); + return VMwareCbtMigrationDetails(vmwareMachineId: vmwareMachineId, osType: osType, osName: osName, firmwareType: firmwareType, targetGeneration: targetGeneration, licenseType: licenseType, sqlServerLicenseType: sqlServerLicenseType, linuxLicenseType: default, dataMoverRunAsAccountId: dataMoverRunAsAccountId, snapshotRunAsAccountId: snapshotRunAsAccountId, storageAccountId: storageAccountId, targetVmName: targetVmName, targetVmSize: targetVmSize, targetLocation: targetLocation, targetResourceGroupId: targetResourceGroupId, targetAvailabilitySetId: targetAvailabilitySetId, targetAvailabilityZone: targetAvailabilityZone, targetProximityPlacementGroupId: targetProximityPlacementGroupId, confidentialVmKeyVaultId: confidentialVmKeyVaultId, targetVmSecurityProfile: targetVmSecurityProfile, targetBootDiagnosticsStorageAccountId: targetBootDiagnosticsStorageAccountId, targetVmTags: targetVmTags, protectedDisks: protectedDisks, targetNetworkId: targetNetworkId, testNetworkId: testNetworkId, vmNics: vmNics, targetNicTags: targetNicTags, migrationRecoveryPointId: migrationRecoveryPointId, lastRecoveryPointReceived: lastRecoveryPointReceived, lastRecoveryPointId: lastRecoveryPointId, initialSeedingProgressPercentage: initialSeedingProgressPercentage, migrationProgressPercentage: migrationProgressPercentage, resyncProgressPercentage: resyncProgressPercentage, resumeProgressPercentage: resumeProgressPercentage, deltaSyncProgressPercentage: default, isCheckSumResyncCycle: default, initialSeedingRetryCount: initialSeedingRetryCount, resyncRetryCount: resyncRetryCount, resumeRetryCount: resumeRetryCount, deltaSyncRetryCount: default, resyncRequired: resyncRequired, resyncState: resyncState, performAutoResync: performAutoResync, seedDiskTags: seedDiskTags, targetDiskTags: targetDiskTags, supportedOSVersions: supportedOSVersions, applianceMonitoringDetails: default, gatewayOperationDetails: default, operationName: default); } /// Initializes a new instance of VMwareCbtProtectedDiskDetails. @@ -6265,7 +7004,7 @@ public static VMwareCbtMigrationDetails VMwareCbtMigrationDetails(ResourceIdenti [EditorBrowsable(EditorBrowsableState.Never)] public static VMwareCbtProtectedDiskDetails VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName) { - return VMwareCbtProtectedDiskDetails(diskId: diskId, diskName: diskName, diskType: diskType, diskPath: diskPath, isOSDisk: isOSDisk, capacityInBytes: capacityInBytes, logStorageAccountId: logStorageAccountId, logStorageAccountSasSecretName: logStorageAccountSasSecretName, diskEncryptionSetId: diskEncryptionSetId, seedManagedDiskId: seedManagedDiskId, seedBlobUri: seedBlobUri, targetManagedDiskId: targetManagedDiskId, targetBlobUri: targetBlobUri, targetDiskName: targetDiskName, gatewayOperationDetails: default); + return VMwareCbtProtectedDiskDetails(diskId: diskId, diskName: diskName, diskType: diskType, diskPath: diskPath, isOSDisk: isOSDisk, capacityInBytes: capacityInBytes, logStorageAccountId: logStorageAccountId, logStorageAccountSasSecretName: logStorageAccountSasSecretName, diskEncryptionSetId: diskEncryptionSetId, seedManagedDiskId: seedManagedDiskId, seedBlobUri: seedBlobUri, targetManagedDiskId: targetManagedDiskId, targetBlobUri: targetBlobUri, targetDiskName: targetDiskName, gatewayOperationDetails: default, sectorSizeInBytes: default, iops: default, throughputInMbps: default, diskSizeInGB: default); } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointCollection.cs new file mode 100644 index 000000000000..3f6f97cc7ebb --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointCollection.cs @@ -0,0 +1,400 @@ +// 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.RecoveryServicesSiteRecovery +{ + /// + /// 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 GetClusterRecoveryPoints method from an instance of . + /// + public partial class ClusterRecoveryPointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _clusterRecoveryPointClientDiagnostics; + private readonly ClusterRecoveryPointRestOperations _clusterRecoveryPointRestClient; + private readonly ClientDiagnostics _clusterRecoveryPointClientDiagnostics0; + private readonly ClusterRecoveryPointsRestOperations _clusterRecoveryPointRestClient0; + + /// Initializes a new instance of the class for mocking. + protected ClusterRecoveryPointCollection() + { + } + + /// 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 ClusterRecoveryPointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _clusterRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ClusterRecoveryPointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ClusterRecoveryPointResource.ResourceType, out string clusterRecoveryPointApiVersion); + _clusterRecoveryPointRestClient = new ClusterRecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, clusterRecoveryPointApiVersion); + _clusterRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ClusterRecoveryPointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ClusterRecoveryPointResource.ResourceType, out string clusterRecoveryPointApiVersion); + _clusterRecoveryPointRestClient = new ClusterRecoveryPointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, clusterRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType), nameof(id)); + } + + /// + /// Get the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point 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 recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = await _clusterRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ClusterRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = _clusterRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ClusterRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The list of cluster recovery points. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints + /// + /// + /// Operation Id + /// ClusterRecoveryPoints_ListByReplicationProtectionCluster + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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) => _clusterRecoveryPointRestClient.CreateListByReplicationProtectionClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _clusterRecoveryPointRestClient.CreateListByReplicationProtectionClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ClusterRecoveryPointResource(Client, ClusterRecoveryPointData.DeserializeClusterRecoveryPointData(e)), _clusterRecoveryPointClientDiagnostics, Pipeline, "ClusterRecoveryPointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// The list of cluster recovery points. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints + /// + /// + /// Operation Id + /// ClusterRecoveryPoints_ListByReplicationProtectionCluster + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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) => _clusterRecoveryPointRestClient.CreateListByReplicationProtectionClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _clusterRecoveryPointRestClient.CreateListByReplicationProtectionClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ClusterRecoveryPointResource(Client, ClusterRecoveryPointData.DeserializeClusterRecoveryPointData(e)), _clusterRecoveryPointClientDiagnostics, Pipeline, "ClusterRecoveryPointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point 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 recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = await _clusterRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = _clusterRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point 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 recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _clusterRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ClusterRecoveryPointResource(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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _clusterRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ClusterRecoveryPointResource(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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.Serialization.cs new file mode 100644 index 000000000000..23e5f00281ff --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.Serialization.cs @@ -0,0 +1,167 @@ +// 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; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + public partial class ClusterRecoveryPointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterRecoveryPointData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ClusterRecoveryPointType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ClusterRecoveryPointType); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ClusterRecoveryPointData 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(ClusterRecoveryPointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterRecoveryPointData(document.RootElement, options); + } + + internal static ClusterRecoveryPointData DeserializeClusterRecoveryPointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = default; + ClusterRecoveryPointProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type0 = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ClusterRecoveryPointProperties.DeserializeClusterRecoveryPointProperties(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)) + { + type0 = 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 ClusterRecoveryPointData( + id, + name, + type0, + systemData, + type, + properties, + 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(ClusterRecoveryPointData)} does not support writing '{options.Format}' format."); + } + } + + ClusterRecoveryPointData 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterRecoveryPointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterRecoveryPointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.cs new file mode 100644 index 000000000000..46e0bb6d9d46 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointData.cs @@ -0,0 +1,79 @@ +// 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.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + /// + /// A class representing the ClusterRecoveryPoint data model. + /// Recovery point. + /// + public partial class ClusterRecoveryPointData : 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 . + internal ClusterRecoveryPointData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource type. + /// The recovery point properties. + /// Keeps track of any properties unknown to the library. + internal ClusterRecoveryPointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string clusterRecoveryPointType, ClusterRecoveryPointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ClusterRecoveryPointType = clusterRecoveryPointType; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource type. + public string ClusterRecoveryPointType { get; } + /// The recovery point properties. + public ClusterRecoveryPointProperties Properties { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.Serialization.cs new file mode 100644 index 000000000000..a53669131ce9 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.RecoveryServicesSiteRecovery +{ + public partial class ClusterRecoveryPointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ClusterRecoveryPointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ClusterRecoveryPointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.cs new file mode 100644 index 000000000000..bedf6fbdcd9d --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ClusterRecoveryPointResource.cs @@ -0,0 +1,174 @@ +// 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.RecoveryServicesSiteRecovery +{ + /// + /// A Class representing a ClusterRecoveryPoint 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 GetClusterRecoveryPointResource method. + /// Otherwise you can get one from its parent resource using the GetClusterRecoveryPoint method. + /// + public partial class ClusterRecoveryPointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The fabricName. + /// The protectionContainerName. + /// The replicationProtectionClusterName. + /// The recoveryPointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, string recoveryPointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _clusterRecoveryPointClientDiagnostics; + private readonly ClusterRecoveryPointRestOperations _clusterRecoveryPointRestClient; + private readonly ClusterRecoveryPointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionClusters/recoveryPoints"; + + /// Initializes a new instance of the class for mocking. + protected ClusterRecoveryPointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ClusterRecoveryPointResource(ArmClient client, ClusterRecoveryPointData 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 ClusterRecoveryPointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _clusterRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string clusterRecoveryPointApiVersion); + _clusterRecoveryPointRestClient = new ClusterRecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, clusterRecoveryPointApiVersion); +#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 ClusterRecoveryPointData 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 the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = await _clusterRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, 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 ClusterRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _clusterRecoveryPointClientDiagnostics.CreateScope("ClusterRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = _clusterRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ClusterRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryArmClient.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryArmClient.cs index 2ace92574b67..41d4f0e07910 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryArmClient.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryArmClient.cs @@ -190,6 +190,42 @@ public virtual SiteRecoveryPointResource GetSiteRecoveryPointResource(ResourceId return new SiteRecoveryPointResource(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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(ResourceIdentifier id) + { + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ValidateResourceId(id); + return new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(ResourceIdentifier id) + { + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.ValidateResourceId(id); + return new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(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 ClusterRecoveryPointResource GetClusterRecoveryPointResource(ResourceIdentifier id) + { + ClusterRecoveryPointResource.ValidateResourceId(id); + return new ClusterRecoveryPointResource(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. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryResourceGroupResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryResourceGroupResource.cs index 2103a298c82d..f26aea17e4c4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryResourceGroupResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/MockableRecoveryServicesSiteRecoveryResourceGroupResource.cs @@ -30,6 +30,8 @@ public partial class MockableRecoveryServicesSiteRecoveryResourceGroupResource : private ReplicationMigrationItemsRestOperations _siteRecoveryMigrationItemReplicationMigrationItemsRestClient; private ClientDiagnostics _replicationProtectedItemClientDiagnostics; private ReplicationProtectedItemsRestOperations _replicationProtectedItemRestClient; + private ClientDiagnostics _replicationProtectionClustersClientDiagnostics; + private ReplicationProtectionClustersRestOperations _replicationProtectionClustersRestClient; private ClientDiagnostics _protectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics; private ReplicationProtectionContainerMappingsRestOperations _protectionContainerMappingReplicationProtectionContainerMappingsRestClient; private ClientDiagnostics _siteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics; @@ -69,6 +71,8 @@ internal MockableRecoveryServicesSiteRecoveryResourceGroupResource(ArmClient cli private ReplicationMigrationItemsRestOperations SiteRecoveryMigrationItemReplicationMigrationItemsRestClient => _siteRecoveryMigrationItemReplicationMigrationItemsRestClient ??= new ReplicationMigrationItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SiteRecoveryMigrationItemResource.ResourceType)); private ClientDiagnostics ReplicationProtectedItemClientDiagnostics => _replicationProtectedItemClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ReplicationProtectedItemResource.ResourceType.Namespace, Diagnostics); private ReplicationProtectedItemsRestOperations ReplicationProtectedItemRestClient => _replicationProtectedItemRestClient ??= new ReplicationProtectedItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ReplicationProtectedItemResource.ResourceType)); + private ClientDiagnostics ReplicationProtectionClustersClientDiagnostics => _replicationProtectionClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ReplicationProtectionClustersRestOperations ReplicationProtectionClustersRestClient => _replicationProtectionClustersRestClient ??= new ReplicationProtectionClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics ProtectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics => _protectionContainerMappingReplicationProtectionContainerMappingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ProtectionContainerMappingResource.ResourceType.Namespace, Diagnostics); private ReplicationProtectionContainerMappingsRestOperations ProtectionContainerMappingReplicationProtectionContainerMappingsRestClient => _protectionContainerMappingReplicationProtectionContainerMappingsRestClient ??= new ReplicationProtectionContainerMappingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ProtectionContainerMappingResource.ResourceType)); private ClientDiagnostics SiteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics => _siteRecoveryServicesProviderReplicationRecoveryServicesProvidersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", SiteRecoveryServicesProviderResource.ResourceType.Namespace, Diagnostics); @@ -113,7 +117,7 @@ public virtual SiteRecoveryAlertCollection GetSiteRecoveryAlerts(string resource /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -145,7 +149,7 @@ public virtual async Task> GetSiteRecoveryAl /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -187,7 +191,7 @@ public virtual ReplicationEligibilityResultCollection GetReplicationEligibilityR /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -218,7 +222,7 @@ public virtual async Task> GetRep /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -259,7 +263,7 @@ public virtual SiteRecoveryEventCollection GetSiteRecoveryEvents(string resource /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -291,7 +295,7 @@ public virtual async Task> GetSiteRecoveryEv /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -333,7 +337,7 @@ public virtual SiteRecoveryFabricCollection GetSiteRecoveryFabrics(string resour /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -366,7 +370,7 @@ public virtual async Task> GetSiteRecoveryF /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -409,7 +413,7 @@ public virtual SiteRecoveryJobCollection GetSiteRecoveryJobs(string resourceName /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -441,7 +445,7 @@ public virtual async Task> GetSiteRecoveryJobA /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -483,7 +487,7 @@ public virtual SiteRecoveryPolicyCollection GetSiteRecoveryPolicies(string resou /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -515,7 +519,7 @@ public virtual async Task> GetSiteRecoveryP /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -557,7 +561,7 @@ public virtual ReplicationProtectionIntentCollection GetReplicationProtectionInt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -589,7 +593,7 @@ public virtual async Task> GetRepl /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -631,7 +635,7 @@ public virtual SiteRecoveryRecoveryPlanCollection GetSiteRecoveryRecoveryPlans(s /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -663,7 +667,7 @@ public virtual async Task> GetSiteRec /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -705,7 +709,7 @@ public virtual SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(s /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -737,7 +741,7 @@ public virtual async Task> GetSiteRec /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -769,7 +773,7 @@ public virtual Response GetSiteRecoveryVaultSe /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -801,7 +805,7 @@ public virtual AsyncPageable GetReplicationApp /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -833,7 +837,7 @@ public virtual Pageable GetReplicationApplianc /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -868,7 +872,7 @@ public virtual AsyncPageable GetSiteRecoveryNetwork /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -903,7 +907,7 @@ public virtual Pageable GetSiteRecoveryNetworks(str /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -938,7 +942,7 @@ public virtual AsyncPageable GetSiteRecovery /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -973,7 +977,7 @@ public virtual Pageable GetSiteRecoveryNetwo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1008,7 +1012,7 @@ public virtual AsyncPageable GetSiteRec /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1043,7 +1047,7 @@ public virtual Pageable GetSiteRecovery /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1081,7 +1085,7 @@ public virtual AsyncPageable GetSiteRecoveryM /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1119,7 +1123,7 @@ public virtual Pageable GetSiteRecoveryMigrat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1156,7 +1160,7 @@ public virtual AsyncPageable GetReplicationPro /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1180,6 +1184,72 @@ public virtual Pageable GetReplicationProtecte return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicationProtectedItemResource(Client, ReplicationProtectedItemData.DeserializeReplicationProtectedItemData(e)), ReplicationProtectedItemClientDiagnostics, Pipeline, "MockableRecoveryServicesSiteRecoveryResourceGroupResource.GetReplicationProtectedItems", "value", "nextLink", cancellationToken); } + /// + /// Gets the list of ASR replication protected clusters in the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_List + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 GetReplicationProtectionClustersAsync(string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationProtectionClustersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationProtectionClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(e), ReplicationProtectionClustersClientDiagnostics, Pipeline, "MockableRecoveryServicesSiteRecoveryResourceGroupResource.GetReplicationProtectionClusters", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of ASR replication protected clusters in the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_List + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 GetReplicationProtectionClusters(string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ReplicationProtectionClustersRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ReplicationProtectionClustersRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, resourceName, skipToken, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(e), ReplicationProtectionClustersClientDiagnostics, Pipeline, "MockableRecoveryServicesSiteRecoveryResourceGroupResource.GetReplicationProtectionClusters", "value", "nextLink", cancellationToken); + } + /// /// Lists the protection container mappings in the vault. /// @@ -1193,7 +1263,7 @@ public virtual Pageable GetReplicationProtecte /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1228,7 +1298,7 @@ public virtual AsyncPageable GetProtectionCo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1263,7 +1333,7 @@ public virtual Pageable GetProtectionContain /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1298,7 +1368,7 @@ public virtual AsyncPageable GetSiteRecove /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1333,7 +1403,7 @@ public virtual Pageable GetSiteRecoverySer /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1368,7 +1438,7 @@ public virtual AsyncPageable GetStorageClassifica /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1403,7 +1473,7 @@ public virtual Pageable GetStorageClassifications /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1438,7 +1508,7 @@ public virtual AsyncPageable GetStorageCla /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1473,7 +1543,7 @@ public virtual Pageable GetStorageClassifi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1508,7 +1578,7 @@ public virtual AsyncPageable GetSiteRecoveryVCenter /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1543,7 +1613,7 @@ public virtual Pageable GetSiteRecoveryVCenters(str /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1583,7 +1653,7 @@ public virtual async Task> GetSu /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1623,7 +1693,7 @@ public virtual Response GetSupportedOpera /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1662,7 +1732,7 @@ public virtual async Task> GetReplicationVaultHealt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1701,7 +1771,7 @@ public virtual Response GetReplicationVaultHealth(string res /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1744,7 +1814,7 @@ public virtual async Task> RefreshReplicationVa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs index fd642d1c924f..244d39c91186 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Extensions/RecoveryServicesSiteRecoveryExtensions.cs @@ -275,6 +275,63 @@ public static SiteRecoveryPointResource GetSiteRecoveryPointResource(this ArmCli return GetMockableRecoveryServicesSiteRecoveryArmClient(client).GetSiteRecoveryPointResource(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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesSiteRecoveryArmClient(client).GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesSiteRecoveryArmClient(client).GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(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 ClusterRecoveryPointResource GetClusterRecoveryPointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesSiteRecoveryArmClient(client).GetClusterRecoveryPointResource(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. @@ -497,7 +554,7 @@ public static SiteRecoveryAlertCollection GetSiteRecoveryAlerts(this ResourceGro /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -536,7 +593,7 @@ public static async Task> GetSiteRecoveryAle /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -594,7 +651,7 @@ public static ReplicationEligibilityResultCollection GetReplicationEligibilityRe /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -632,7 +689,7 @@ public static async Task> GetRepl /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -689,7 +746,7 @@ public static SiteRecoveryEventCollection GetSiteRecoveryEvents(this ResourceGro /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -728,7 +785,7 @@ public static async Task> GetSiteRecoveryEve /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -786,7 +843,7 @@ public static SiteRecoveryFabricCollection GetSiteRecoveryFabrics(this ResourceG /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -826,7 +883,7 @@ public static async Task> GetSiteRecoveryFa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -885,7 +942,7 @@ public static SiteRecoveryJobCollection GetSiteRecoveryJobs(this ResourceGroupRe /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -924,7 +981,7 @@ public static async Task> GetSiteRecoveryJobAs /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -982,7 +1039,7 @@ public static SiteRecoveryPolicyCollection GetSiteRecoveryPolicies(this Resource /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1021,7 +1078,7 @@ public static async Task> GetSiteRecoveryPo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1079,7 +1136,7 @@ public static ReplicationProtectionIntentCollection GetReplicationProtectionInte /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1118,7 +1175,7 @@ public static async Task> GetRepli /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1176,7 +1233,7 @@ public static SiteRecoveryRecoveryPlanCollection GetSiteRecoveryRecoveryPlans(th /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1215,7 +1272,7 @@ public static async Task> GetSiteReco /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1273,7 +1330,7 @@ public static SiteRecoveryVaultSettingCollection GetSiteRecoveryVaultSettings(th /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1312,7 +1369,7 @@ public static async Task> GetSiteReco /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1351,7 +1408,7 @@ public static Response GetSiteRecoveryVaultSet /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1386,7 +1443,7 @@ public static AsyncPageable GetReplicationAppl /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1421,7 +1478,7 @@ public static Pageable GetReplicationAppliance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1459,7 +1516,7 @@ public static AsyncPageable GetSiteRecoveryNetworks /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1497,7 +1554,7 @@ public static Pageable GetSiteRecoveryNetworks(this /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1535,7 +1592,7 @@ public static AsyncPageable GetSiteRecoveryN /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1573,7 +1630,7 @@ public static Pageable GetSiteRecoveryNetwor /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1611,7 +1668,7 @@ public static AsyncPageable GetSiteReco /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1649,7 +1706,7 @@ public static Pageable GetSiteRecoveryP /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1690,7 +1747,7 @@ public static AsyncPageable GetSiteRecoveryMi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1731,7 +1788,7 @@ public static Pageable GetSiteRecoveryMigrati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1771,7 +1828,7 @@ public static AsyncPageable GetReplicationProt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1798,6 +1855,78 @@ public static Pageable GetReplicationProtected return GetMockableRecoveryServicesSiteRecoveryResourceGroupResource(resourceGroupResource).GetReplicationProtectedItems(resourceName, skipToken, filter, cancellationToken); } + /// + /// Gets the list of ASR replication protected clusters in the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_List + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetReplicationProtectionClustersAsync(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesSiteRecoveryResourceGroupResource(resourceGroupResource).GetReplicationProtectionClustersAsync(resourceName, skipToken, filter, cancellationToken); + } + + /// + /// Gets the list of ASR replication protected clusters in the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_List + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetReplicationProtectionClusters(this ResourceGroupResource resourceGroupResource, string resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesSiteRecoveryResourceGroupResource(resourceGroupResource).GetReplicationProtectionClusters(resourceName, skipToken, filter, cancellationToken); + } + /// /// Lists the protection container mappings in the vault. /// @@ -1811,7 +1940,7 @@ public static Pageable GetReplicationProtected /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1849,7 +1978,7 @@ public static AsyncPageable GetProtectionCon /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1887,7 +2016,7 @@ public static Pageable GetProtectionContaine /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1925,7 +2054,7 @@ public static AsyncPageable GetSiteRecover /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1963,7 +2092,7 @@ public static Pageable GetSiteRecoveryServ /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2001,7 +2130,7 @@ public static AsyncPageable GetStorageClassificat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2039,7 +2168,7 @@ public static Pageable GetStorageClassifications( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2077,7 +2206,7 @@ public static AsyncPageable GetStorageClas /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2115,7 +2244,7 @@ public static Pageable GetStorageClassific /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2153,7 +2282,7 @@ public static AsyncPageable GetSiteRecoveryVCenters /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -2191,7 +2320,7 @@ public static Pageable GetSiteRecoveryVCenters(this /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -2225,7 +2354,7 @@ public static async Task> GetSup /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -2259,7 +2388,7 @@ public static Response GetSupportedOperat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -2292,7 +2421,7 @@ public static async Task> GetReplicationVaultHealth /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -2325,7 +2454,7 @@ public static Response GetReplicationVaultHealth(this Resour /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -2359,7 +2488,7 @@ public static async Task> RefreshReplicationVau /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/LongRunningOperation/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/LongRunningOperation/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource.cs new file mode 100644 index 000000000000..da0bb9cf5e0c --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/LongRunningOperation/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + internal class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(ArmClient client) + { + _client = client; + } + + VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointCollection.cs index 8c31a8794eeb..bae258a2ec84 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string migrationReco /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string migrationRecoveryPo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string migrationRecoveryPointName, Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointResource.cs index 9fb63bad1217..81bf104301e9 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/MigrationRecoveryPointResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.Serialization.cs new file mode 100644 index 000000000000..5e86a81c94ca --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AApplyClusterRecoveryPointContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AApplyClusterRecoveryPointContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + A2AApplyClusterRecoveryPointContent 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(A2AApplyClusterRecoveryPointContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AApplyClusterRecoveryPointContent(document.RootElement, options); + } + + internal static A2AApplyClusterRecoveryPointContent DeserializeA2AApplyClusterRecoveryPointContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AApplyClusterRecoveryPointContent(instanceType, 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(A2AApplyClusterRecoveryPointContent)} does not support writing '{options.Format}' format."); + } + } + + A2AApplyClusterRecoveryPointContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AApplyClusterRecoveryPointContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AApplyClusterRecoveryPointContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.cs new file mode 100644 index 000000000000..bec053ddc5ca --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AApplyClusterRecoveryPointContent.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific input for apply cluster recovery point. + public partial class A2AApplyClusterRecoveryPointContent : ApplyClusterRecoveryPointProviderSpecificContent + { + /// Initializes a new instance of . + public A2AApplyClusterRecoveryPointContent() + { + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal A2AApplyClusterRecoveryPointContent(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "A2A"; + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.Serialization.cs new file mode 100644 index 000000000000..e34db92ff78a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.Serialization.cs @@ -0,0 +1,162 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AClusterRecoveryPointDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AClusterRecoveryPointDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(RecoveryPointSyncType)) + { + writer.WritePropertyName("recoveryPointSyncType"u8); + writer.WriteStringValue(RecoveryPointSyncType.Value.ToString()); + } + if (Optional.IsCollectionDefined(Nodes)) + { + writer.WritePropertyName("nodes"u8); + writer.WriteStartArray(); + foreach (var item in Nodes) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + A2AClusterRecoveryPointDetails 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(A2AClusterRecoveryPointDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AClusterRecoveryPointDetails(document.RootElement, options); + } + + internal static A2AClusterRecoveryPointDetails DeserializeA2AClusterRecoveryPointDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RecoveryPointSyncType? recoveryPointSyncType = default; + IReadOnlyList nodes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointSyncType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointSyncType = new RecoveryPointSyncType(property.Value.GetString()); + continue; + } + if (property.NameEquals("nodes"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())); + } + } + nodes = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AClusterRecoveryPointDetails(instanceType, serializedAdditionalRawData, recoveryPointSyncType, nodes ?? new ChangeTrackingList()); + } + + 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(A2AClusterRecoveryPointDetails)} does not support writing '{options.Format}' format."); + } + } + + A2AClusterRecoveryPointDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AClusterRecoveryPointDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AClusterRecoveryPointDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.cs new file mode 100644 index 000000000000..c7a18e4df79f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterRecoveryPointDetails.cs @@ -0,0 +1,41 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific cluster recovery point details. + public partial class A2AClusterRecoveryPointDetails : ClusterProviderSpecificRecoveryPointDetails + { + /// Initializes a new instance of . + internal A2AClusterRecoveryPointDetails() + { + Nodes = new ChangeTrackingList(); + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// Gets the provider type. + /// Keeps track of any properties unknown to the library. + /// A value indicating whether the recovery point is multi VM consistent. + /// The list of nodes representing the cluster. + internal A2AClusterRecoveryPointDetails(string instanceType, IDictionary serializedAdditionalRawData, RecoveryPointSyncType? recoveryPointSyncType, IReadOnlyList nodes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointSyncType = recoveryPointSyncType; + Nodes = nodes; + InstanceType = instanceType ?? "A2A"; + } + + /// A value indicating whether the recovery point is multi VM consistent. + public RecoveryPointSyncType? RecoveryPointSyncType { get; } + /// The list of nodes representing the cluster. + public IReadOnlyList Nodes { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.Serialization.cs new file mode 100644 index 000000000000..a16cb015ca2a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.Serialization.cs @@ -0,0 +1,150 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AClusterTestFailoverContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AClusterTestFailoverContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ClusterRecoveryPointId)) + { + writer.WritePropertyName("clusterRecoveryPointId"u8); + writer.WriteStringValue(ClusterRecoveryPointId); + } + if (Optional.IsCollectionDefined(IndividualNodeRecoveryPoints)) + { + writer.WritePropertyName("individualNodeRecoveryPoints"u8); + writer.WriteStartArray(); + foreach (var item in IndividualNodeRecoveryPoints) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + A2AClusterTestFailoverContent 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(A2AClusterTestFailoverContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AClusterTestFailoverContent(document.RootElement, options); + } + + internal static A2AClusterTestFailoverContent DeserializeA2AClusterTestFailoverContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier clusterRecoveryPointId = default; + IList individualNodeRecoveryPoints = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterRecoveryPointId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterRecoveryPointId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("individualNodeRecoveryPoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + individualNodeRecoveryPoints = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AClusterTestFailoverContent(instanceType, serializedAdditionalRawData, clusterRecoveryPointId, individualNodeRecoveryPoints ?? new ChangeTrackingList()); + } + + 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(A2AClusterTestFailoverContent)} does not support writing '{options.Format}' format."); + } + } + + A2AClusterTestFailoverContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AClusterTestFailoverContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AClusterTestFailoverContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.cs new file mode 100644 index 000000000000..fa43b22c76f5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterTestFailoverContent.cs @@ -0,0 +1,41 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific input for test cluster failover. + public partial class A2AClusterTestFailoverContent : ClusterTestFailoverProviderSpecificContent + { + /// Initializes a new instance of . + public A2AClusterTestFailoverContent() + { + IndividualNodeRecoveryPoints = new ChangeTrackingList(); + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + /// The cluster recovery point id to be passed to failover to a particular recovery point. + /// The list of individual node recovery points. + internal A2AClusterTestFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier clusterRecoveryPointId, IList individualNodeRecoveryPoints) : base(instanceType, serializedAdditionalRawData) + { + ClusterRecoveryPointId = clusterRecoveryPointId; + IndividualNodeRecoveryPoints = individualNodeRecoveryPoints; + InstanceType = instanceType ?? "A2A"; + } + + /// The cluster recovery point id to be passed to failover to a particular recovery point. + public ResourceIdentifier ClusterRecoveryPointId { get; set; } + /// The list of individual node recovery points. + public IList IndividualNodeRecoveryPoints { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.Serialization.cs new file mode 100644 index 000000000000..77ae4ff02fd7 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.Serialization.cs @@ -0,0 +1,150 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AClusterUnplannedFailoverContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AClusterUnplannedFailoverContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ClusterRecoveryPointId)) + { + writer.WritePropertyName("clusterRecoveryPointId"u8); + writer.WriteStringValue(ClusterRecoveryPointId); + } + if (Optional.IsCollectionDefined(IndividualNodeRecoveryPoints)) + { + writer.WritePropertyName("individualNodeRecoveryPoints"u8); + writer.WriteStartArray(); + foreach (var item in IndividualNodeRecoveryPoints) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + A2AClusterUnplannedFailoverContent 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(A2AClusterUnplannedFailoverContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AClusterUnplannedFailoverContent(document.RootElement, options); + } + + internal static A2AClusterUnplannedFailoverContent DeserializeA2AClusterUnplannedFailoverContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier clusterRecoveryPointId = default; + IList individualNodeRecoveryPoints = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterRecoveryPointId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterRecoveryPointId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("individualNodeRecoveryPoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + individualNodeRecoveryPoints = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AClusterUnplannedFailoverContent(instanceType, serializedAdditionalRawData, clusterRecoveryPointId, individualNodeRecoveryPoints ?? new ChangeTrackingList()); + } + + 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(A2AClusterUnplannedFailoverContent)} does not support writing '{options.Format}' format."); + } + } + + A2AClusterUnplannedFailoverContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AClusterUnplannedFailoverContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AClusterUnplannedFailoverContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.cs new file mode 100644 index 000000000000..6f31cc1ac04c --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AClusterUnplannedFailoverContent.cs @@ -0,0 +1,41 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific input for unplanned cluster failover. + public partial class A2AClusterUnplannedFailoverContent : ClusterUnplannedFailoverProviderSpecificContent + { + /// Initializes a new instance of . + public A2AClusterUnplannedFailoverContent() + { + IndividualNodeRecoveryPoints = new ChangeTrackingList(); + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + /// The cluster recovery point id to be passed to failover to a particular recovery point. + /// The list of individual node recovery points. + internal A2AClusterUnplannedFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier clusterRecoveryPointId, IList individualNodeRecoveryPoints) : base(instanceType, serializedAdditionalRawData) + { + ClusterRecoveryPointId = clusterRecoveryPointId; + IndividualNodeRecoveryPoints = individualNodeRecoveryPoints; + InstanceType = instanceType ?? "A2A"; + } + + /// The cluster recovery point id to be passed to failover to a particular recovery point. + public ResourceIdentifier ClusterRecoveryPointId { get; set; } + /// The list of individual node recovery points. + public IList IndividualNodeRecoveryPoints { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.Serialization.cs index 4dae1263a323..8d93134a760d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.Serialization.cs @@ -92,6 +92,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("multiVmGroupId"u8); writer.WriteStringValue(MultiVmGroupId); } + if (Optional.IsDefined(ProtectionClusterId)) + { + writer.WritePropertyName("protectionClusterId"u8); + writer.WriteStringValue(ProtectionClusterId); + } if (Optional.IsDefined(RecoveryBootDiagStorageAccountId)) { writer.WritePropertyName("recoveryBootDiagStorageAccountId"u8); @@ -169,6 +174,7 @@ internal static A2AEnableProtectionContent DeserializeA2AEnableProtectionContent IList vmManagedDisks = default; string multiVmGroupName = default; string multiVmGroupId = default; + ResourceIdentifier protectionClusterId = default; ResourceIdentifier recoveryBootDiagStorageAccountId = default; SiteRecoveryDiskEncryptionInfo diskEncryptionInfo = default; string recoveryAvailabilityZone = default; @@ -267,6 +273,15 @@ internal static A2AEnableProtectionContent DeserializeA2AEnableProtectionContent multiVmGroupId = property.Value.GetString(); continue; } + if (property.NameEquals("protectionClusterId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectionClusterId = new ResourceIdentifier(property.Value.GetString()); + continue; + } if (property.NameEquals("recoveryBootDiagStorageAccountId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -364,6 +379,7 @@ internal static A2AEnableProtectionContent DeserializeA2AEnableProtectionContent vmManagedDisks ?? new ChangeTrackingList(), multiVmGroupName, multiVmGroupId, + protectionClusterId, recoveryBootDiagStorageAccountId, diskEncryptionInfo, recoveryAvailabilityZone, diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.cs index 417784c5e235..17884a289bcb 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AEnableProtectionContent.cs @@ -40,6 +40,7 @@ public A2AEnableProtectionContent(ResourceIdentifier fabricObjectId) /// The list of vm managed disk details. /// The multi vm group name. /// The multi vm group id. + /// The replication protection cluster Id. /// The boot diagnostic storage account. /// The recovery disk encryption information (for two pass flows). /// The recovery availability zone. @@ -49,7 +50,7 @@ public A2AEnableProtectionContent(ResourceIdentifier fabricObjectId) /// The virtual machine scale set Id. /// The recovery capacity reservation group Id. /// A value indicating whether the auto protection is enabled. - internal A2AEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier fabricObjectId, ResourceIdentifier recoveryContainerId, ResourceIdentifier recoveryResourceGroupId, string recoveryCloudServiceId, ResourceIdentifier recoveryAvailabilitySetId, ResourceIdentifier recoveryProximityPlacementGroupId, IList vmDisks, IList vmManagedDisks, string multiVmGroupName, string multiVmGroupId, ResourceIdentifier recoveryBootDiagStorageAccountId, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation recoveryExtendedLocation, ResourceIdentifier recoveryAzureNetworkId, string recoverySubnetName, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk) : base(instanceType, serializedAdditionalRawData) + internal A2AEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier fabricObjectId, ResourceIdentifier recoveryContainerId, ResourceIdentifier recoveryResourceGroupId, string recoveryCloudServiceId, ResourceIdentifier recoveryAvailabilitySetId, ResourceIdentifier recoveryProximityPlacementGroupId, IList vmDisks, IList vmManagedDisks, string multiVmGroupName, string multiVmGroupId, ResourceIdentifier protectionClusterId, ResourceIdentifier recoveryBootDiagStorageAccountId, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation recoveryExtendedLocation, ResourceIdentifier recoveryAzureNetworkId, string recoverySubnetName, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk) : base(instanceType, serializedAdditionalRawData) { FabricObjectId = fabricObjectId; RecoveryContainerId = recoveryContainerId; @@ -61,6 +62,7 @@ internal A2AEnableProtectionContent(string instanceType, IDictionary The multi vm group id. public string MultiVmGroupId { get; set; } + /// The replication protection cluster Id. + public ResourceIdentifier ProtectionClusterId { get; set; } /// The boot diagnostic storage account. public ResourceIdentifier RecoveryBootDiagStorageAccountId { get; set; } /// The recovery disk encryption information (for two pass flows). diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.Serialization.cs new file mode 100644 index 000000000000..7af8107e446a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.Serialization.cs @@ -0,0 +1,281 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AProtectedItemDetail : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AProtectedItemDetail)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VmManagedDisks)) + { + writer.WritePropertyName("vmManagedDisks"u8); + writer.WriteStartArray(); + foreach (var item in VmManagedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RecoveryResourceGroupId)) + { + writer.WritePropertyName("recoveryResourceGroupId"u8); + writer.WriteStringValue(RecoveryResourceGroupId); + } + if (Optional.IsDefined(RecoveryAvailabilitySetId)) + { + writer.WritePropertyName("recoveryAvailabilitySetId"u8); + writer.WriteStringValue(RecoveryAvailabilitySetId); + } + if (Optional.IsDefined(RecoveryBootDiagStorageAccountId)) + { + writer.WritePropertyName("recoveryBootDiagStorageAccountId"u8); + writer.WriteStringValue(RecoveryBootDiagStorageAccountId); + } + if (Optional.IsDefined(RecoveryAvailabilityZone)) + { + writer.WritePropertyName("recoveryAvailabilityZone"u8); + writer.WriteStringValue(RecoveryAvailabilityZone); + } + if (Optional.IsDefined(RecoveryProximityPlacementGroupId)) + { + writer.WritePropertyName("recoveryProximityPlacementGroupId"u8); + writer.WriteStringValue(RecoveryProximityPlacementGroupId); + } + if (Optional.IsDefined(RecoveryVirtualMachineScaleSetId)) + { + writer.WritePropertyName("recoveryVirtualMachineScaleSetId"u8); + writer.WriteStringValue(RecoveryVirtualMachineScaleSetId); + } + if (Optional.IsDefined(RecoveryCapacityReservationGroupId)) + { + writer.WritePropertyName("recoveryCapacityReservationGroupId"u8); + writer.WriteStringValue(RecoveryCapacityReservationGroupId); + } + if (Optional.IsDefined(DiskEncryptionInfo)) + { + writer.WritePropertyName("diskEncryptionInfo"u8); + writer.WriteObjectValue(DiskEncryptionInfo, options); + } + if (Optional.IsDefined(ReplicationProtectedItemName)) + { + writer.WritePropertyName("replicationProtectedItemName"u8); + writer.WriteStringValue(ReplicationProtectedItemName); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + A2AProtectedItemDetail 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(A2AProtectedItemDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AProtectedItemDetail(document.RootElement, options); + } + + internal static A2AProtectedItemDetail DeserializeA2AProtectedItemDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList vmManagedDisks = default; + ResourceIdentifier recoveryResourceGroupId = default; + ResourceIdentifier recoveryAvailabilitySetId = default; + ResourceIdentifier recoveryBootDiagStorageAccountId = default; + string recoveryAvailabilityZone = default; + ResourceIdentifier recoveryProximityPlacementGroupId = default; + ResourceIdentifier recoveryVirtualMachineScaleSetId = default; + ResourceIdentifier recoveryCapacityReservationGroupId = default; + SiteRecoveryDiskEncryptionInfo diskEncryptionInfo = default; + string replicationProtectedItemName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmManagedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(A2AVmManagedDiskDetails.DeserializeA2AVmManagedDiskDetails(item, options)); + } + vmManagedDisks = array; + continue; + } + if (property.NameEquals("recoveryResourceGroupId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryResourceGroupId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryAvailabilitySetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryAvailabilitySetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryBootDiagStorageAccountId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryBootDiagStorageAccountId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryAvailabilityZone"u8)) + { + recoveryAvailabilityZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryProximityPlacementGroupId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryProximityPlacementGroupId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryVirtualMachineScaleSetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryVirtualMachineScaleSetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryCapacityReservationGroupId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryCapacityReservationGroupId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskEncryptionInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionInfo = SiteRecoveryDiskEncryptionInfo.DeserializeSiteRecoveryDiskEncryptionInfo(property.Value, options); + continue; + } + if (property.NameEquals("replicationProtectedItemName"u8)) + { + replicationProtectedItemName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AProtectedItemDetail( + vmManagedDisks ?? new ChangeTrackingList(), + recoveryResourceGroupId, + recoveryAvailabilitySetId, + recoveryBootDiagStorageAccountId, + recoveryAvailabilityZone, + recoveryProximityPlacementGroupId, + recoveryVirtualMachineScaleSetId, + recoveryCapacityReservationGroupId, + diskEncryptionInfo, + replicationProtectedItemName, + 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(A2AProtectedItemDetail)} does not support writing '{options.Format}' format."); + } + } + + A2AProtectedItemDetail 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AProtectedItemDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AProtectedItemDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.cs new file mode 100644 index 000000000000..b956c5e26deb --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedItemDetail.cs @@ -0,0 +1,103 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A specific switch cluster protection input. + public partial class A2AProtectedItemDetail + { + /// + /// 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 A2AProtectedItemDetail() + { + VmManagedDisks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of vm managed disk details. + /// The recovery resource group Id. + /// The recovery availability set. + /// The boot diagnostic storage account. + /// The recovery availability zone. + /// The recovery proximity placement group Id. + /// The virtual machine scale set id. + /// The recovery capacity reservation group Id. + /// The recovery disk encryption information. + /// The Replication Protected item name. + /// Keeps track of any properties unknown to the library. + internal A2AProtectedItemDetail(IList vmManagedDisks, ResourceIdentifier recoveryResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, ResourceIdentifier recoveryBootDiagStorageAccountId, string recoveryAvailabilityZone, ResourceIdentifier recoveryProximityPlacementGroupId, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, SiteRecoveryDiskEncryptionInfo diskEncryptionInfo, string replicationProtectedItemName, IDictionary serializedAdditionalRawData) + { + VmManagedDisks = vmManagedDisks; + RecoveryResourceGroupId = recoveryResourceGroupId; + RecoveryAvailabilitySetId = recoveryAvailabilitySetId; + RecoveryBootDiagStorageAccountId = recoveryBootDiagStorageAccountId; + RecoveryAvailabilityZone = recoveryAvailabilityZone; + RecoveryProximityPlacementGroupId = recoveryProximityPlacementGroupId; + RecoveryVirtualMachineScaleSetId = recoveryVirtualMachineScaleSetId; + RecoveryCapacityReservationGroupId = recoveryCapacityReservationGroupId; + DiskEncryptionInfo = diskEncryptionInfo; + ReplicationProtectedItemName = replicationProtectedItemName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of vm managed disk details. + public IList VmManagedDisks { get; } + /// The recovery resource group Id. + public ResourceIdentifier RecoveryResourceGroupId { get; set; } + /// The recovery availability set. + public ResourceIdentifier RecoveryAvailabilitySetId { get; set; } + /// The boot diagnostic storage account. + public ResourceIdentifier RecoveryBootDiagStorageAccountId { get; set; } + /// The recovery availability zone. + public string RecoveryAvailabilityZone { get; set; } + /// The recovery proximity placement group Id. + public ResourceIdentifier RecoveryProximityPlacementGroupId { get; set; } + /// The virtual machine scale set id. + public ResourceIdentifier RecoveryVirtualMachineScaleSetId { get; set; } + /// The recovery capacity reservation group Id. + public ResourceIdentifier RecoveryCapacityReservationGroupId { get; set; } + /// The recovery disk encryption information. + public SiteRecoveryDiskEncryptionInfo DiskEncryptionInfo { get; set; } + /// The Replication Protected item name. + public string ReplicationProtectedItemName { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.Serialization.cs index 0553fc546eb9..79933eb31803 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.Serialization.cs @@ -235,7 +235,7 @@ internal static A2AProtectedManagedDiskDetails DeserializeA2AProtectedManagedDis double? dataPendingInStagingStorageAccountInMB = default; double? dataPendingAtSourceAgentInMB = default; string diskState = default; - IReadOnlyList allowedDiskLevelOperation = default; + IList allowedDiskLevelOperation = default; bool? isDiskEncrypted = default; string secretIdentifier = default; ResourceIdentifier dekKeyVaultArmId = default; diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.cs index 2ec408ef5018..30ef1074da6b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AProtectedManagedDiskDetails.cs @@ -47,7 +47,7 @@ public partial class A2AProtectedManagedDiskDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal A2AProtectedManagedDiskDetails() + public A2AProtectedManagedDiskDetails() { AllowedDiskLevelOperation = new ChangeTrackingList(); } @@ -82,7 +82,7 @@ internal A2AProtectedManagedDiskDetails() /// The failover name for the managed disk. /// The test failover name for the managed disk. /// Keeps track of any properties unknown to the library. - internal A2AProtectedManagedDiskDetails(string diskId, ResourceIdentifier recoveryResourceGroupId, ResourceIdentifier recoveryTargetDiskId, ResourceIdentifier recoveryReplicaDiskId, ResourceIdentifier recoveryOrignalTargetDiskId, string recoveryReplicaDiskAccountType, string recoveryTargetDiskAccountType, ResourceIdentifier recoveryDiskEncryptionSetId, ResourceIdentifier primaryDiskEncryptionSetId, string diskName, long? diskCapacityInBytes, ResourceIdentifier primaryStagingAzureStorageAccountId, string diskType, bool? isResyncRequired, int? monitoringPercentageCompletion, string monitoringJobType, double? dataPendingInStagingStorageAccountInMB, double? dataPendingAtSourceAgentInMB, string diskState, IReadOnlyList allowedDiskLevelOperation, bool? isDiskEncrypted, string secretIdentifier, ResourceIdentifier dekKeyVaultArmId, bool? isDiskKeyEncrypted, string keyIdentifier, ResourceIdentifier kekKeyVaultArmId, string failoverDiskName, string tfoDiskName, IDictionary serializedAdditionalRawData) + internal A2AProtectedManagedDiskDetails(string diskId, ResourceIdentifier recoveryResourceGroupId, ResourceIdentifier recoveryTargetDiskId, ResourceIdentifier recoveryReplicaDiskId, ResourceIdentifier recoveryOrignalTargetDiskId, string recoveryReplicaDiskAccountType, string recoveryTargetDiskAccountType, ResourceIdentifier recoveryDiskEncryptionSetId, ResourceIdentifier primaryDiskEncryptionSetId, string diskName, long? diskCapacityInBytes, ResourceIdentifier primaryStagingAzureStorageAccountId, string diskType, bool? isResyncRequired, int? monitoringPercentageCompletion, string monitoringJobType, double? dataPendingInStagingStorageAccountInMB, double? dataPendingAtSourceAgentInMB, string diskState, IList allowedDiskLevelOperation, bool? isDiskEncrypted, string secretIdentifier, ResourceIdentifier dekKeyVaultArmId, bool? isDiskKeyEncrypted, string keyIdentifier, ResourceIdentifier kekKeyVaultArmId, string failoverDiskName, string tfoDiskName, IDictionary serializedAdditionalRawData) { DiskId = diskId; RecoveryResourceGroupId = recoveryResourceGroupId; @@ -116,60 +116,60 @@ internal A2AProtectedManagedDiskDetails(string diskId, ResourceIdentifier recove } /// The managed disk Arm id. - public string DiskId { get; } + public string DiskId { get; set; } /// The recovery disk resource group Arm Id. - public ResourceIdentifier RecoveryResourceGroupId { get; } + public ResourceIdentifier RecoveryResourceGroupId { get; set; } /// Recovery target disk Arm Id. - public ResourceIdentifier RecoveryTargetDiskId { get; } + public ResourceIdentifier RecoveryTargetDiskId { get; set; } /// Recovery replica disk Arm Id. - public ResourceIdentifier RecoveryReplicaDiskId { get; } + public ResourceIdentifier RecoveryReplicaDiskId { get; set; } /// Recovery original target disk Arm Id. - public ResourceIdentifier RecoveryOrignalTargetDiskId { get; } + public ResourceIdentifier RecoveryOrignalTargetDiskId { get; set; } /// The replica disk type. Its an optional value and will be same as source disk type if not user provided. - public string RecoveryReplicaDiskAccountType { get; } + public string RecoveryReplicaDiskAccountType { get; set; } /// The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. - public string RecoveryTargetDiskAccountType { get; } + public string RecoveryTargetDiskAccountType { get; set; } /// The recovery disk encryption set Id. - public ResourceIdentifier RecoveryDiskEncryptionSetId { get; } + public ResourceIdentifier RecoveryDiskEncryptionSetId { get; set; } /// The primary disk encryption set Id. - public ResourceIdentifier PrimaryDiskEncryptionSetId { get; } + public ResourceIdentifier PrimaryDiskEncryptionSetId { get; set; } /// The disk name. - public string DiskName { get; } + public string DiskName { get; set; } /// The disk capacity in bytes. - public long? DiskCapacityInBytes { get; } + public long? DiskCapacityInBytes { get; set; } /// The primary staging storage account. - public ResourceIdentifier PrimaryStagingAzureStorageAccountId { get; } + public ResourceIdentifier PrimaryStagingAzureStorageAccountId { get; set; } /// The type of disk. - public string DiskType { get; } + public string DiskType { get; set; } /// A value indicating whether resync is required for this disk. - public bool? IsResyncRequired { get; } + public bool? IsResyncRequired { get; set; } /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - public int? MonitoringPercentageCompletion { get; } + public int? MonitoringPercentageCompletion { get; set; } /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - public string MonitoringJobType { get; } + public string MonitoringJobType { get; set; } /// The data pending for replication in MB at staging account. - public double? DataPendingInStagingStorageAccountInMB { get; } + public double? DataPendingInStagingStorageAccountInMB { get; set; } /// The data pending at source virtual machine in MB. - public double? DataPendingAtSourceAgentInMB { get; } + public double? DataPendingAtSourceAgentInMB { get; set; } /// The disk state. - public string DiskState { get; } + public string DiskState { get; set; } /// The disk level operations list. - public IReadOnlyList AllowedDiskLevelOperation { get; } + public IList AllowedDiskLevelOperation { get; } /// A value indicating whether vm has encrypted os disk or not. - public bool? IsDiskEncrypted { get; } + public bool? IsDiskEncrypted { get; set; } /// The secret URL / identifier (BEK). - public string SecretIdentifier { get; } + public string SecretIdentifier { get; set; } /// The KeyVault resource id for secret (BEK). - public ResourceIdentifier DekKeyVaultArmId { get; } + public ResourceIdentifier DekKeyVaultArmId { get; set; } /// A value indicating whether disk key got encrypted or not. - public bool? IsDiskKeyEncrypted { get; } + public bool? IsDiskKeyEncrypted { get; set; } /// The key URL / identifier (KEK). - public string KeyIdentifier { get; } + public string KeyIdentifier { get; set; } /// The KeyVault resource id for key (KEK). - public ResourceIdentifier KekKeyVaultArmId { get; } + public ResourceIdentifier KekKeyVaultArmId { get; set; } /// The failover name for the managed disk. - public string FailoverDiskName { get; } + public string FailoverDiskName { get; set; } /// The test failover name for the managed disk. - public string TfoDiskName { get; } + public string TfoDiskName { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.Serialization.cs index 0b5ceaad0d44..e400802d9548 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.Serialization.cs @@ -90,6 +90,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("managementId"u8); writer.WriteStringValue(ManagementId); } + if (Optional.IsDefined(ProtectionClusterId)) + { + writer.WritePropertyName("protectionClusterId"u8); + writer.WriteStringValue(ProtectionClusterId); + } + if (Optional.IsDefined(IsClusterInfraReady)) + { + writer.WritePropertyName("isClusterInfraReady"u8); + writer.WriteBooleanValue(IsClusterInfraReady.Value); + } if (Optional.IsCollectionDefined(ProtectedDisks)) { writer.WritePropertyName("protectedDisks"u8); @@ -358,6 +368,8 @@ internal static A2AReplicationDetails DeserializeA2AReplicationDetails(JsonEleme string multiVmGroupName = default; MultiVmGroupCreateOption? multiVmGroupCreateOption = default; string managementId = default; + string protectionClusterId = default; + bool? isClusterInfraReady = default; IReadOnlyList protectedDisks = default; IReadOnlyList unprotectedDisks = default; IReadOnlyList protectedManagedDisks = default; @@ -485,6 +497,20 @@ internal static A2AReplicationDetails DeserializeA2AReplicationDetails(JsonEleme managementId = property.Value.GetString(); continue; } + if (property.NameEquals("protectionClusterId"u8)) + { + protectionClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isClusterInfraReady"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isClusterInfraReady = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("protectedDisks"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -861,6 +887,8 @@ internal static A2AReplicationDetails DeserializeA2AReplicationDetails(JsonEleme multiVmGroupName, multiVmGroupCreateOption, managementId, + protectionClusterId, + isClusterInfraReady, protectedDisks ?? new ChangeTrackingList(), unprotectedDisks ?? new ChangeTrackingList(), protectedManagedDisks ?? new ChangeTrackingList(), diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.cs index 7b7def36b60b..2379742f20be 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationDetails.cs @@ -38,6 +38,8 @@ internal A2AReplicationDetails() /// The multi vm group name. /// Whether Multi VM group is auto created or specified by user. /// The management Id. + /// The replication protection cluster Id. + /// A value indicating if the cluster infra is ready or not. /// The list of protected disks. /// The list of unprotected disks. /// The list of protected managed disks. @@ -81,7 +83,7 @@ internal A2AReplicationDetails() /// The recovery virtual machine scale set id. /// The recovery capacity reservation group Id. /// A value indicating the churn option selected by user. - internal A2AReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, IReadOnlyList protectedDisks, IReadOnlyList unprotectedDisks, IReadOnlyList protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IReadOnlyList vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, ChurnOptionSelected? churnOptionSelected) : base(instanceType, serializedAdditionalRawData) + internal A2AReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier fabricObjectId, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, AzureLocation? initialRecoveryFabricLocation, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, string managementId, string protectionClusterId, bool? isClusterInfraReady, IReadOnlyList protectedDisks, IReadOnlyList unprotectedDisks, IReadOnlyList protectedManagedDisks, ResourceIdentifier recoveryBootDiagStorageAccountId, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, string osType, string recoveryAzureVmSize, string recoveryAzureVmName, ResourceIdentifier recoveryAzureResourceGroupId, string recoveryCloudService, string recoveryAvailabilitySet, ResourceIdentifier selectedRecoveryAzureNetworkId, ResourceIdentifier selectedTfoAzureNetworkId, IReadOnlyList vmNics, A2AVmSyncedConfigDetails vmSyncedConfigDetails, int? monitoringPercentageCompletion, string monitoringJobType, DateTimeOffset? lastHeartbeat, string agentVersion, DateTimeOffset? agentExpireOn, bool? isReplicationAgentUpdateRequired, DateTimeOffset? agentCertificateExpireOn, bool? isReplicationAgentCertificateUpdateRequired, ResourceIdentifier recoveryFabricObjectId, string vmProtectionState, string vmProtectionStateDescription, string lifecycleId, ResourceIdentifier testFailoverRecoveryFabricObjectId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, SiteRecoveryVmEncryptionType? vmEncryptionType, string tfoAzureVmName, string recoveryAzureGeneration, ResourceIdentifier recoveryProximityPlacementGroupId, AutoProtectionOfDataDisk? autoProtectionOfDataDisk, ResourceIdentifier recoveryVirtualMachineScaleSetId, ResourceIdentifier recoveryCapacityReservationGroupId, ChurnOptionSelected? churnOptionSelected) : base(instanceType, serializedAdditionalRawData) { FabricObjectId = fabricObjectId; InitialPrimaryZone = initialPrimaryZone; @@ -94,6 +96,8 @@ internal A2AReplicationDetails(string instanceType, IDictionary The management Id. public string ManagementId { get; } + /// The replication protection cluster Id. + public string ProtectionClusterId { get; } + /// A value indicating if the cluster infra is ready or not. + public bool? IsClusterInfraReady { get; } /// The list of protected disks. public IReadOnlyList ProtectedDisks { get; } /// The list of unprotected disks. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.Serialization.cs new file mode 100644 index 000000000000..0a05eab30f15 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.Serialization.cs @@ -0,0 +1,400 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2AReplicationProtectionClusterDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2AReplicationProtectionClusterDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(MultiVmGroupId)) + { + writer.WritePropertyName("multiVmGroupId"u8); + writer.WriteStringValue(MultiVmGroupId); + } + if (Optional.IsDefined(MultiVmGroupName)) + { + writer.WritePropertyName("multiVmGroupName"u8); + writer.WriteStringValue(MultiVmGroupName); + } + if (Optional.IsDefined(MultiVmGroupCreateOption)) + { + writer.WritePropertyName("multiVmGroupCreateOption"u8); + writer.WriteStringValue(MultiVmGroupCreateOption.Value.ToString()); + } + if (Optional.IsDefined(PrimaryFabricLocation)) + { + writer.WritePropertyName("primaryFabricLocation"u8); + writer.WriteStringValue(PrimaryFabricLocation.Value); + } + if (Optional.IsDefined(RecoveryFabricLocation)) + { + writer.WritePropertyName("recoveryFabricLocation"u8); + writer.WriteStringValue(RecoveryFabricLocation.Value); + } + if (Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (Optional.IsDefined(ClusterManagementId)) + { + writer.WritePropertyName("clusterManagementId"u8); + writer.WriteStringValue(ClusterManagementId); + } + if (Optional.IsDefined(RpoInSeconds)) + { + writer.WritePropertyName("rpoInSeconds"u8); + writer.WriteNumberValue(RpoInSeconds.Value); + } + if (Optional.IsDefined(LastRpoCalculatedOn)) + { + writer.WritePropertyName("lastRpoCalculatedTime"u8); + writer.WriteStringValue(LastRpoCalculatedOn.Value, "O"); + } + if (Optional.IsDefined(InitialPrimaryZone)) + { + writer.WritePropertyName("initialPrimaryZone"u8); + writer.WriteStringValue(InitialPrimaryZone); + } + if (Optional.IsDefined(InitialPrimaryFabricLocation)) + { + writer.WritePropertyName("initialPrimaryFabricLocation"u8); + writer.WriteStringValue(InitialPrimaryFabricLocation.Value); + } + if (Optional.IsDefined(InitialRecoveryZone)) + { + writer.WritePropertyName("initialRecoveryZone"u8); + writer.WriteStringValue(InitialRecoveryZone); + } + if (Optional.IsDefined(InitialRecoveryFabricLocation)) + { + writer.WritePropertyName("initialRecoveryFabricLocation"u8); + writer.WriteStringValue(InitialRecoveryFabricLocation.Value); + } + if (Optional.IsDefined(InitialPrimaryExtendedLocation)) + { + writer.WritePropertyName("initialPrimaryExtendedLocation"u8); + writer.WriteObjectValue(InitialPrimaryExtendedLocation, options); + } + if (Optional.IsDefined(InitialRecoveryExtendedLocation)) + { + writer.WritePropertyName("initialRecoveryExtendedLocation"u8); + writer.WriteObjectValue(InitialRecoveryExtendedLocation, options); + } + if (Optional.IsDefined(PrimaryAvailabilityZone)) + { + writer.WritePropertyName("primaryAvailabilityZone"u8); + writer.WriteStringValue(PrimaryAvailabilityZone); + } + if (Optional.IsDefined(RecoveryAvailabilityZone)) + { + writer.WritePropertyName("recoveryAvailabilityZone"u8); + writer.WriteStringValue(RecoveryAvailabilityZone); + } + if (Optional.IsDefined(PrimaryExtendedLocation)) + { + writer.WritePropertyName("primaryExtendedLocation"u8); + writer.WriteObjectValue(PrimaryExtendedLocation, options); + } + if (Optional.IsDefined(RecoveryExtendedLocation)) + { + writer.WritePropertyName("recoveryExtendedLocation"u8); + writer.WriteObjectValue(RecoveryExtendedLocation, options); + } + if (Optional.IsDefined(LifecycleId)) + { + writer.WritePropertyName("lifecycleId"u8); + writer.WriteStringValue(LifecycleId); + } + } + + A2AReplicationProtectionClusterDetails 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(A2AReplicationProtectionClusterDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2AReplicationProtectionClusterDetails(document.RootElement, options); + } + + internal static A2AReplicationProtectionClusterDetails DeserializeA2AReplicationProtectionClusterDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string multiVmGroupId = default; + string multiVmGroupName = default; + MultiVmGroupCreateOption? multiVmGroupCreateOption = default; + AzureLocation? primaryFabricLocation = default; + AzureLocation? recoveryFabricLocation = default; + ResourceIdentifier failoverRecoveryPointId = default; + string clusterManagementId = default; + long? rpoInSeconds = default; + DateTimeOffset? lastRpoCalculatedTime = default; + string initialPrimaryZone = default; + AzureLocation? initialPrimaryFabricLocation = default; + string initialRecoveryZone = default; + AzureLocation? initialRecoveryFabricLocation = default; + SiteRecoveryExtendedLocation initialPrimaryExtendedLocation = default; + SiteRecoveryExtendedLocation initialRecoveryExtendedLocation = default; + string primaryAvailabilityZone = default; + string recoveryAvailabilityZone = default; + SiteRecoveryExtendedLocation primaryExtendedLocation = default; + SiteRecoveryExtendedLocation recoveryExtendedLocation = default; + string lifecycleId = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("multiVmGroupId"u8)) + { + multiVmGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("multiVmGroupName"u8)) + { + multiVmGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("multiVmGroupCreateOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + multiVmGroupCreateOption = new MultiVmGroupCreateOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("primaryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primaryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverRecoveryPointId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("clusterManagementId"u8)) + { + clusterManagementId = property.Value.GetString(); + continue; + } + if (property.NameEquals("rpoInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rpoInSeconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastRpoCalculatedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRpoCalculatedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("initialPrimaryZone"u8)) + { + initialPrimaryZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialPrimaryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialPrimaryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("initialRecoveryZone"u8)) + { + initialRecoveryZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialRecoveryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialRecoveryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("initialPrimaryExtendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialPrimaryExtendedLocation = SiteRecoveryExtendedLocation.DeserializeSiteRecoveryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("initialRecoveryExtendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialRecoveryExtendedLocation = SiteRecoveryExtendedLocation.DeserializeSiteRecoveryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("primaryAvailabilityZone"u8)) + { + primaryAvailabilityZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryAvailabilityZone"u8)) + { + recoveryAvailabilityZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryExtendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primaryExtendedLocation = SiteRecoveryExtendedLocation.DeserializeSiteRecoveryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("recoveryExtendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryExtendedLocation = SiteRecoveryExtendedLocation.DeserializeSiteRecoveryExtendedLocation(property.Value, options); + continue; + } + if (property.NameEquals("lifecycleId"u8)) + { + lifecycleId = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2AReplicationProtectionClusterDetails( + instanceType, + serializedAdditionalRawData, + multiVmGroupId, + multiVmGroupName, + multiVmGroupCreateOption, + primaryFabricLocation, + recoveryFabricLocation, + failoverRecoveryPointId, + clusterManagementId, + rpoInSeconds, + lastRpoCalculatedTime, + initialPrimaryZone, + initialPrimaryFabricLocation, + initialRecoveryZone, + initialRecoveryFabricLocation, + initialPrimaryExtendedLocation, + initialRecoveryExtendedLocation, + primaryAvailabilityZone, + recoveryAvailabilityZone, + primaryExtendedLocation, + recoveryExtendedLocation, + lifecycleId); + } + + 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(A2AReplicationProtectionClusterDetails)} does not support writing '{options.Format}' format."); + } + } + + A2AReplicationProtectionClusterDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2AReplicationProtectionClusterDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2AReplicationProtectionClusterDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.cs new file mode 100644 index 000000000000..efa3dd0e9d7e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AReplicationProtectionClusterDetails.cs @@ -0,0 +1,112 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific settings. + public partial class A2AReplicationProtectionClusterDetails : ReplicationClusterProviderSpecificSettings + { + /// Initializes a new instance of . + public A2AReplicationProtectionClusterDetails() + { + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + /// The multi vm group Id. + /// The multi vm group name. + /// Whether Multi VM group is auto created or specified by user. + /// Primary fabric location. + /// The recovery fabric location. + /// The recovery point Id to which the cluster was failed over. + /// The cluster management Id. + /// The last RPO value in seconds. + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + /// The initial primary availability zone. + /// The initial primary fabric location. + /// The initial recovery availability zone. + /// The initial recovery fabric location. + /// The initial primary extended location. + /// The initial recovery extended location. + /// The primary availability zone. + /// The recovery availability zone. + /// The primary Extended Location. + /// The recovery Extended Location. + /// An id that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected cluster even though other internal Ids/ARM Id might be changing. + internal A2AReplicationProtectionClusterDetails(string instanceType, IDictionary serializedAdditionalRawData, string multiVmGroupId, string multiVmGroupName, MultiVmGroupCreateOption? multiVmGroupCreateOption, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, ResourceIdentifier failoverRecoveryPointId, string clusterManagementId, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string initialPrimaryZone, AzureLocation? initialPrimaryFabricLocation, string initialRecoveryZone, AzureLocation? initialRecoveryFabricLocation, SiteRecoveryExtendedLocation initialPrimaryExtendedLocation, SiteRecoveryExtendedLocation initialRecoveryExtendedLocation, string primaryAvailabilityZone, string recoveryAvailabilityZone, SiteRecoveryExtendedLocation primaryExtendedLocation, SiteRecoveryExtendedLocation recoveryExtendedLocation, string lifecycleId) : base(instanceType, serializedAdditionalRawData) + { + MultiVmGroupId = multiVmGroupId; + MultiVmGroupName = multiVmGroupName; + MultiVmGroupCreateOption = multiVmGroupCreateOption; + PrimaryFabricLocation = primaryFabricLocation; + RecoveryFabricLocation = recoveryFabricLocation; + FailoverRecoveryPointId = failoverRecoveryPointId; + ClusterManagementId = clusterManagementId; + RpoInSeconds = rpoInSeconds; + LastRpoCalculatedOn = lastRpoCalculatedOn; + InitialPrimaryZone = initialPrimaryZone; + InitialPrimaryFabricLocation = initialPrimaryFabricLocation; + InitialRecoveryZone = initialRecoveryZone; + InitialRecoveryFabricLocation = initialRecoveryFabricLocation; + InitialPrimaryExtendedLocation = initialPrimaryExtendedLocation; + InitialRecoveryExtendedLocation = initialRecoveryExtendedLocation; + PrimaryAvailabilityZone = primaryAvailabilityZone; + RecoveryAvailabilityZone = recoveryAvailabilityZone; + PrimaryExtendedLocation = primaryExtendedLocation; + RecoveryExtendedLocation = recoveryExtendedLocation; + LifecycleId = lifecycleId; + InstanceType = instanceType ?? "A2A"; + } + + /// The multi vm group Id. + public string MultiVmGroupId { get; set; } + /// The multi vm group name. + public string MultiVmGroupName { get; set; } + /// Whether Multi VM group is auto created or specified by user. + public MultiVmGroupCreateOption? MultiVmGroupCreateOption { get; set; } + /// Primary fabric location. + public AzureLocation? PrimaryFabricLocation { get; set; } + /// The recovery fabric location. + public AzureLocation? RecoveryFabricLocation { get; set; } + /// The recovery point Id to which the cluster was failed over. + public ResourceIdentifier FailoverRecoveryPointId { get; set; } + /// The cluster management Id. + public string ClusterManagementId { get; set; } + /// The last RPO value in seconds. + public long? RpoInSeconds { get; set; } + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + public DateTimeOffset? LastRpoCalculatedOn { get; set; } + /// The initial primary availability zone. + public string InitialPrimaryZone { get; set; } + /// The initial primary fabric location. + public AzureLocation? InitialPrimaryFabricLocation { get; set; } + /// The initial recovery availability zone. + public string InitialRecoveryZone { get; set; } + /// The initial recovery fabric location. + public AzureLocation? InitialRecoveryFabricLocation { get; set; } + /// The initial primary extended location. + public SiteRecoveryExtendedLocation InitialPrimaryExtendedLocation { get; set; } + /// The initial recovery extended location. + public SiteRecoveryExtendedLocation InitialRecoveryExtendedLocation { get; set; } + /// The primary availability zone. + public string PrimaryAvailabilityZone { get; set; } + /// The recovery availability zone. + public string RecoveryAvailabilityZone { get; set; } + /// The primary Extended Location. + public SiteRecoveryExtendedLocation PrimaryExtendedLocation { get; set; } + /// The recovery Extended Location. + public SiteRecoveryExtendedLocation RecoveryExtendedLocation { get; set; } + /// An id that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected cluster even though other internal Ids/ARM Id might be changing. + public string LifecycleId { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.Serialization.cs new file mode 100644 index 000000000000..76d07c692ef8 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.Serialization.cs @@ -0,0 +1,179 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2ASharedDiskIRErrorDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2ASharedDiskIRErrorDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ErrorCode)) + { + writer.WritePropertyName("errorCode"u8); + writer.WriteStringValue(ErrorCode); + } + if (options.Format != "W" && Optional.IsDefined(ErrorCodeEnum)) + { + writer.WritePropertyName("errorCodeEnum"u8); + writer.WriteStringValue(ErrorCodeEnum); + } + if (options.Format != "W" && Optional.IsDefined(ErrorMessage)) + { + writer.WritePropertyName("errorMessage"u8); + writer.WriteStringValue(ErrorMessage); + } + if (options.Format != "W" && Optional.IsDefined(PossibleCauses)) + { + writer.WritePropertyName("possibleCauses"u8); + writer.WriteStringValue(PossibleCauses); + } + if (options.Format != "W" && Optional.IsDefined(RecommendedAction)) + { + writer.WritePropertyName("recommendedAction"u8); + writer.WriteStringValue(RecommendedAction); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + A2ASharedDiskIRErrorDetails 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(A2ASharedDiskIRErrorDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2ASharedDiskIRErrorDetails(document.RootElement, options); + } + + internal static A2ASharedDiskIRErrorDetails DeserializeA2ASharedDiskIRErrorDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string errorCode = default; + string errorCodeEnum = default; + string errorMessage = default; + string possibleCauses = default; + string recommendedAction = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("errorCode"u8)) + { + errorCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorCodeEnum"u8)) + { + errorCodeEnum = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage"u8)) + { + errorMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("possibleCauses"u8)) + { + possibleCauses = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendedAction"u8)) + { + recommendedAction = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2ASharedDiskIRErrorDetails( + errorCode, + errorCodeEnum, + errorMessage, + possibleCauses, + recommendedAction, + 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(A2ASharedDiskIRErrorDetails)} does not support writing '{options.Format}' format."); + } + } + + A2ASharedDiskIRErrorDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2ASharedDiskIRErrorDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2ASharedDiskIRErrorDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.cs new file mode 100644 index 000000000000..3d346252ec54 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskIRErrorDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Extended location of the resource. + public partial class A2ASharedDiskIRErrorDetails + { + /// + /// 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 A2ASharedDiskIRErrorDetails() + { + } + + /// Initializes a new instance of . + /// The error code. + /// The error code enum. + /// The error message. + /// The possible causes. + /// The recommended action. + /// Keeps track of any properties unknown to the library. + internal A2ASharedDiskIRErrorDetails(string errorCode, string errorCodeEnum, string errorMessage, string possibleCauses, string recommendedAction, IDictionary serializedAdditionalRawData) + { + ErrorCode = errorCode; + ErrorCodeEnum = errorCodeEnum; + ErrorMessage = errorMessage; + PossibleCauses = possibleCauses; + RecommendedAction = recommendedAction; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error code. + public string ErrorCode { get; } + /// The error code enum. + public string ErrorCodeEnum { get; } + /// The error message. + public string ErrorMessage { get; } + /// The possible causes. + public string PossibleCauses { get; } + /// The recommended action. + public string RecommendedAction { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.Serialization.cs new file mode 100644 index 000000000000..379ba8c39194 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.Serialization.cs @@ -0,0 +1,310 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2ASharedDiskReplicationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2ASharedDiskReplicationDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ManagementId)) + { + writer.WritePropertyName("managementId"u8); + writer.WriteStringValue(ManagementId); + } + if (Optional.IsCollectionDefined(UnprotectedDisks)) + { + writer.WritePropertyName("unprotectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in UnprotectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ProtectedManagedDisks)) + { + writer.WritePropertyName("protectedManagedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedManagedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PrimaryFabricLocation)) + { + writer.WritePropertyName("primaryFabricLocation"u8); + writer.WriteStringValue(PrimaryFabricLocation.Value); + } + if (Optional.IsDefined(RecoveryFabricLocation)) + { + writer.WritePropertyName("recoveryFabricLocation"u8); + writer.WriteStringValue(RecoveryFabricLocation.Value); + } + if (Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (Optional.IsDefined(MonitoringPercentageCompletion)) + { + writer.WritePropertyName("monitoringPercentageCompletion"u8); + writer.WriteNumberValue(MonitoringPercentageCompletion.Value); + } + if (Optional.IsDefined(MonitoringJobType)) + { + writer.WritePropertyName("monitoringJobType"u8); + writer.WriteStringValue(MonitoringJobType); + } + if (Optional.IsDefined(RpoInSeconds)) + { + writer.WritePropertyName("rpoInSeconds"u8); + writer.WriteNumberValue(RpoInSeconds.Value); + } + if (Optional.IsDefined(LastRpoCalculatedOn)) + { + writer.WritePropertyName("lastRpoCalculatedTime"u8); + writer.WriteStringValue(LastRpoCalculatedOn.Value, "O"); + } + if (Optional.IsCollectionDefined(SharedDiskIRErrors)) + { + writer.WritePropertyName("sharedDiskIRErrors"u8); + writer.WriteStartArray(); + foreach (var item in SharedDiskIRErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + A2ASharedDiskReplicationDetails 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(A2ASharedDiskReplicationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2ASharedDiskReplicationDetails(document.RootElement, options); + } + + internal static A2ASharedDiskReplicationDetails DeserializeA2ASharedDiskReplicationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string managementId = default; + IList unprotectedDisks = default; + IList protectedManagedDisks = default; + AzureLocation? primaryFabricLocation = default; + AzureLocation? recoveryFabricLocation = default; + ResourceIdentifier failoverRecoveryPointId = default; + int? monitoringPercentageCompletion = default; + string monitoringJobType = default; + long? rpoInSeconds = default; + DateTimeOffset? lastRpoCalculatedTime = default; + IList sharedDiskIRErrors = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managementId"u8)) + { + managementId = property.Value.GetString(); + continue; + } + if (property.NameEquals("unprotectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(A2AUnprotectedDiskDetails.DeserializeA2AUnprotectedDiskDetails(item, options)); + } + unprotectedDisks = array; + continue; + } + if (property.NameEquals("protectedManagedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(A2AProtectedManagedDiskDetails.DeserializeA2AProtectedManagedDiskDetails(item, options)); + } + protectedManagedDisks = array; + continue; + } + if (property.NameEquals("primaryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primaryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("recoveryFabricLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryFabricLocation = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverRecoveryPointId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("monitoringPercentageCompletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + monitoringPercentageCompletion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("monitoringJobType"u8)) + { + monitoringJobType = property.Value.GetString(); + continue; + } + if (property.NameEquals("rpoInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rpoInSeconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastRpoCalculatedTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRpoCalculatedTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("sharedDiskIRErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(A2ASharedDiskIRErrorDetails.DeserializeA2ASharedDiskIRErrorDetails(item, options)); + } + sharedDiskIRErrors = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2ASharedDiskReplicationDetails( + instanceType, + serializedAdditionalRawData, + managementId, + unprotectedDisks ?? new ChangeTrackingList(), + protectedManagedDisks ?? new ChangeTrackingList(), + primaryFabricLocation, + recoveryFabricLocation, + failoverRecoveryPointId, + monitoringPercentageCompletion, + monitoringJobType, + rpoInSeconds, + lastRpoCalculatedTime, + sharedDiskIRErrors ?? new ChangeTrackingList()); + } + + 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(A2ASharedDiskReplicationDetails)} does not support writing '{options.Format}' format."); + } + } + + A2ASharedDiskReplicationDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2ASharedDiskReplicationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2ASharedDiskReplicationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.cs new file mode 100644 index 000000000000..62a65e670ef5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASharedDiskReplicationDetails.cs @@ -0,0 +1,79 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A provider specific settings. + public partial class A2ASharedDiskReplicationDetails : SharedDiskReplicationProviderSpecificSettings + { + /// Initializes a new instance of . + public A2ASharedDiskReplicationDetails() + { + UnprotectedDisks = new ChangeTrackingList(); + ProtectedManagedDisks = new ChangeTrackingList(); + SharedDiskIRErrors = new ChangeTrackingList(); + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + /// The management Id. + /// The list of unprotected disks. + /// The list of protected managed disks. + /// Primary fabric location. + /// The recovery fabric location. + /// The recovery point id to which the Virtual node was failed over. + /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + /// The last RPO value in seconds. + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + /// The IR Errors. + internal A2ASharedDiskReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, string managementId, IList unprotectedDisks, IList protectedManagedDisks, AzureLocation? primaryFabricLocation, AzureLocation? recoveryFabricLocation, ResourceIdentifier failoverRecoveryPointId, int? monitoringPercentageCompletion, string monitoringJobType, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, IList sharedDiskIRErrors) : base(instanceType, serializedAdditionalRawData) + { + ManagementId = managementId; + UnprotectedDisks = unprotectedDisks; + ProtectedManagedDisks = protectedManagedDisks; + PrimaryFabricLocation = primaryFabricLocation; + RecoveryFabricLocation = recoveryFabricLocation; + FailoverRecoveryPointId = failoverRecoveryPointId; + MonitoringPercentageCompletion = monitoringPercentageCompletion; + MonitoringJobType = monitoringJobType; + RpoInSeconds = rpoInSeconds; + LastRpoCalculatedOn = lastRpoCalculatedOn; + SharedDiskIRErrors = sharedDiskIRErrors; + InstanceType = instanceType ?? "A2A"; + } + + /// The management Id. + public string ManagementId { get; set; } + /// The list of unprotected disks. + public IList UnprotectedDisks { get; } + /// The list of protected managed disks. + public IList ProtectedManagedDisks { get; } + /// Primary fabric location. + public AzureLocation? PrimaryFabricLocation { get; set; } + /// The recovery fabric location. + public AzureLocation? RecoveryFabricLocation { get; set; } + /// The recovery point id to which the Virtual node was failed over. + public ResourceIdentifier FailoverRecoveryPointId { get; set; } + /// The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. + public int? MonitoringPercentageCompletion { get; set; } + /// The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. + public string MonitoringJobType { get; set; } + /// The last RPO value in seconds. + public long? RpoInSeconds { get; set; } + /// The time (in UTC) when the last RPO value was calculated by Protection Service. + public DateTimeOffset? LastRpoCalculatedOn { get; set; } + /// The IR Errors. + public IList SharedDiskIRErrors { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.Serialization.cs new file mode 100644 index 000000000000..fdc3c8a5c68e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.Serialization.cs @@ -0,0 +1,165 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class A2ASwitchClusterProtectionContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(A2ASwitchClusterProtectionContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(RecoveryContainerId)) + { + writer.WritePropertyName("recoveryContainerId"u8); + writer.WriteStringValue(RecoveryContainerId); + } + if (Optional.IsDefined(PolicyId)) + { + writer.WritePropertyName("policyId"u8); + writer.WriteStringValue(PolicyId); + } + if (Optional.IsCollectionDefined(ProtectedItemsDetail)) + { + writer.WritePropertyName("protectedItemsDetail"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemsDetail) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + A2ASwitchClusterProtectionContent 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(A2ASwitchClusterProtectionContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeA2ASwitchClusterProtectionContent(document.RootElement, options); + } + + internal static A2ASwitchClusterProtectionContent DeserializeA2ASwitchClusterProtectionContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier recoveryContainerId = default; + ResourceIdentifier policyId = default; + IList protectedItemsDetail = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("policyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectedItemsDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(A2AProtectedItemDetail.DeserializeA2AProtectedItemDetail(item, options)); + } + protectedItemsDetail = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new A2ASwitchClusterProtectionContent(instanceType, serializedAdditionalRawData, recoveryContainerId, policyId, protectedItemsDetail ?? new ChangeTrackingList()); + } + + 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(A2ASwitchClusterProtectionContent)} does not support writing '{options.Format}' format."); + } + } + + A2ASwitchClusterProtectionContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeA2ASwitchClusterProtectionContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(A2ASwitchClusterProtectionContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.cs new file mode 100644 index 000000000000..3c186104227e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2ASwitchClusterProtectionContent.cs @@ -0,0 +1,45 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// A2A specific switch cluster protection input. + public partial class A2ASwitchClusterProtectionContent : SwitchClusterProtectionProviderSpecificContent + { + /// Initializes a new instance of . + public A2ASwitchClusterProtectionContent() + { + ProtectedItemsDetail = new ChangeTrackingList(); + InstanceType = "A2A"; + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + /// The recovery container Id. + /// The Policy Id. + /// + internal A2ASwitchClusterProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier recoveryContainerId, ResourceIdentifier policyId, IList protectedItemsDetail) : base(instanceType, serializedAdditionalRawData) + { + RecoveryContainerId = recoveryContainerId; + PolicyId = policyId; + ProtectedItemsDetail = protectedItemsDetail; + InstanceType = instanceType ?? "A2A"; + } + + /// The recovery container Id. + public ResourceIdentifier RecoveryContainerId { get; set; } + /// The Policy Id. + public ResourceIdentifier PolicyId { get; set; } + /// Gets the protected items detail. + public IList ProtectedItemsDetail { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AUnprotectedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AUnprotectedDiskDetails.cs index f29aaec37ca7..c2e3d1d49f9c 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AUnprotectedDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/A2AUnprotectedDiskDetails.cs @@ -46,7 +46,7 @@ public partial class A2AUnprotectedDiskDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal A2AUnprotectedDiskDetails() + public A2AUnprotectedDiskDetails() { } @@ -62,8 +62,8 @@ internal A2AUnprotectedDiskDetails(int? diskLunId, AutoProtectionOfDataDisk? dis } /// The source lun Id for the data disk. - public int? DiskLunId { get; } + public int? DiskLunId { get; set; } /// A value indicating whether the disk auto protection is enabled. - public AutoProtectionOfDataDisk? DiskAutoProtectionStatus { get; } + public AutoProtectionOfDataDisk? DiskAutoProtectionStatus { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.Serialization.cs new file mode 100644 index 000000000000..c5572e8eb345 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.Serialization.cs @@ -0,0 +1,126 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ApplyClusterRecoveryPointContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointContent)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplyClusterRecoveryPointContent 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(ApplyClusterRecoveryPointContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplyClusterRecoveryPointContent(document.RootElement, options); + } + + internal static ApplyClusterRecoveryPointContent DeserializeApplyClusterRecoveryPointContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ApplyClusterRecoveryPointContentProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ApplyClusterRecoveryPointContentProperties.DeserializeApplyClusterRecoveryPointContentProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplyClusterRecoveryPointContent(properties, 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(ApplyClusterRecoveryPointContent)} does not support writing '{options.Format}' format."); + } + } + + ApplyClusterRecoveryPointContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplyClusterRecoveryPointContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.cs new file mode 100644 index 000000000000..053a44d4a190 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContent.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for apply cluster recovery point. + public partial class ApplyClusterRecoveryPointContent + { + /// + /// 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 properties to apply cluster recovery point input. + /// is null. + public ApplyClusterRecoveryPointContent(ApplyClusterRecoveryPointContentProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The properties to apply cluster recovery point input. + /// Keeps track of any properties unknown to the library. + internal ApplyClusterRecoveryPointContent(ApplyClusterRecoveryPointContentProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplyClusterRecoveryPointContent() + { + } + + /// The properties to apply cluster recovery point input. + public ApplyClusterRecoveryPointContentProperties Properties { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.Serialization.cs new file mode 100644 index 000000000000..b08b5f0c929e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.Serialization.cs @@ -0,0 +1,178 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ApplyClusterRecoveryPointContentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointContentProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClusterRecoveryPointId)) + { + writer.WritePropertyName("clusterRecoveryPointId"u8); + writer.WriteStringValue(ClusterRecoveryPointId); + } + if (Optional.IsCollectionDefined(IndividualNodeRecoveryPoints)) + { + writer.WritePropertyName("individualNodeRecoveryPoints"u8); + writer.WriteStartArray(); + foreach (var item in IndividualNodeRecoveryPoints) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplyClusterRecoveryPointContentProperties 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(ApplyClusterRecoveryPointContentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplyClusterRecoveryPointContentProperties(document.RootElement, options); + } + + internal static ApplyClusterRecoveryPointContentProperties DeserializeApplyClusterRecoveryPointContentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier clusterRecoveryPointId = default; + IList individualNodeRecoveryPoints = default; + ApplyClusterRecoveryPointProviderSpecificContent providerSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterRecoveryPointId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterRecoveryPointId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("individualNodeRecoveryPoints"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())); + } + } + individualNodeRecoveryPoints = array; + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + providerSpecificDetails = ApplyClusterRecoveryPointProviderSpecificContent.DeserializeApplyClusterRecoveryPointProviderSpecificContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplyClusterRecoveryPointContentProperties(clusterRecoveryPointId, individualNodeRecoveryPoints ?? new ChangeTrackingList(), providerSpecificDetails, 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(ApplyClusterRecoveryPointContentProperties)} does not support writing '{options.Format}' format."); + } + } + + ApplyClusterRecoveryPointContentProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplyClusterRecoveryPointContentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointContentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.cs new file mode 100644 index 000000000000..5333b673eb27 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointContentProperties.cs @@ -0,0 +1,97 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for apply cluster recovery point properties. + public partial class ApplyClusterRecoveryPointContentProperties + { + /// + /// 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 provider specific input for applying cluster recovery point. + /// 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 . + /// + /// is null. + public ApplyClusterRecoveryPointContentProperties(ApplyClusterRecoveryPointProviderSpecificContent providerSpecificDetails) + { + Argument.AssertNotNull(providerSpecificDetails, nameof(providerSpecificDetails)); + + IndividualNodeRecoveryPoints = new ChangeTrackingList(); + ProviderSpecificDetails = providerSpecificDetails; + } + + /// Initializes a new instance of . + /// The cluster recovery point id to be passed to failover to a particular recovery point. + /// The list of individual node recovery points. + /// + /// The provider specific input for applying cluster recovery point. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ApplyClusterRecoveryPointContentProperties(ResourceIdentifier clusterRecoveryPointId, IList individualNodeRecoveryPoints, ApplyClusterRecoveryPointProviderSpecificContent providerSpecificDetails, IDictionary serializedAdditionalRawData) + { + ClusterRecoveryPointId = clusterRecoveryPointId; + IndividualNodeRecoveryPoints = individualNodeRecoveryPoints; + ProviderSpecificDetails = providerSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplyClusterRecoveryPointContentProperties() + { + } + + /// The cluster recovery point id to be passed to failover to a particular recovery point. + public ResourceIdentifier ClusterRecoveryPointId { get; set; } + /// The list of individual node recovery points. + public IList IndividualNodeRecoveryPoints { get; } + /// + /// The provider specific input for applying cluster recovery point. + /// 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 . + /// + public ApplyClusterRecoveryPointProviderSpecificContent ProviderSpecificDetails { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..b6e591cfa488 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownApplyClusterRecoveryPointProviderSpecificContent))] + public partial class ApplyClusterRecoveryPointProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointProviderSpecificContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplyClusterRecoveryPointProviderSpecificContent 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(ApplyClusterRecoveryPointProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplyClusterRecoveryPointProviderSpecificContent(document.RootElement, options); + } + + internal static ApplyClusterRecoveryPointProviderSpecificContent DeserializeApplyClusterRecoveryPointProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2AApplyClusterRecoveryPointContent.DeserializeA2AApplyClusterRecoveryPointContent(element, options); + } + } + return UnknownApplyClusterRecoveryPointProviderSpecificContent.DeserializeUnknownApplyClusterRecoveryPointProviderSpecificContent(element, options); + } + + 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(ApplyClusterRecoveryPointProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ApplyClusterRecoveryPointProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplyClusterRecoveryPointProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.cs new file mode 100644 index 000000000000..95d6722cdae9 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ApplyClusterRecoveryPointProviderSpecificContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Provider specific input for apply cluster recovery point. + /// 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 . + /// + public abstract partial class ApplyClusterRecoveryPointProviderSpecificContent + { + /// + /// 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 ApplyClusterRecoveryPointProviderSpecificContent() + { + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal ApplyClusterRecoveryPointProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.Serialization.cs new file mode 100644 index 000000000000..7c1d0b04b5bc --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.Serialization.cs @@ -0,0 +1,150 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterFailoverJobDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterFailoverJobDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ClusterFailoverJobDetails 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(ClusterFailoverJobDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterFailoverJobDetails(document.RootElement, options); + } + + internal static ClusterFailoverJobDetails DeserializeClusterFailoverJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + IReadOnlyDictionary affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverReplicationProtectedItemDetails.DeserializeFailoverReplicationProtectedItemDetails(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"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()); + } + affectedObjectDetails = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterFailoverJobDetails(instanceType, affectedObjectDetails ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + 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(ClusterFailoverJobDetails)} does not support writing '{options.Format}' format."); + } + } + + ClusterFailoverJobDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterFailoverJobDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterFailoverJobDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.cs new file mode 100644 index 000000000000..620395e71a7d --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterFailoverJobDetails.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// This class represents the details for a failover job of cluster. + public partial class ClusterFailoverJobDetails : SiteRecoveryJobDetails + { + /// Initializes a new instance of . + internal ClusterFailoverJobDetails() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "ClusterFailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Gets the type of job details (see JobDetailsTypes enum for possible values). + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// Keeps track of any properties unknown to the library. + /// The test VM details. + internal ClusterFailoverJobDetails(string instanceType, IReadOnlyDictionary affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "ClusterFailoverJobDetails"; + } + + /// The test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.Serialization.cs new file mode 100644 index 000000000000..4806bd9e7430 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownClusterProviderSpecificRecoveryPointDetails))] + public partial class ClusterProviderSpecificRecoveryPointDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterProviderSpecificRecoveryPointDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterProviderSpecificRecoveryPointDetails 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(ClusterProviderSpecificRecoveryPointDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterProviderSpecificRecoveryPointDetails(document.RootElement, options); + } + + internal static ClusterProviderSpecificRecoveryPointDetails DeserializeClusterProviderSpecificRecoveryPointDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2AClusterRecoveryPointDetails.DeserializeA2AClusterRecoveryPointDetails(element, options); + } + } + return UnknownClusterProviderSpecificRecoveryPointDetails.DeserializeUnknownClusterProviderSpecificRecoveryPointDetails(element, options); + } + + 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(ClusterProviderSpecificRecoveryPointDetails)} does not support writing '{options.Format}' format."); + } + } + + ClusterProviderSpecificRecoveryPointDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterProviderSpecificRecoveryPointDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterProviderSpecificRecoveryPointDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.cs new file mode 100644 index 000000000000..63b654cee1bf --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterProviderSpecificRecoveryPointDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Replication provider specific cluster recovery point 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 . + /// + public abstract partial class ClusterProviderSpecificRecoveryPointDetails + { + /// + /// 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 ClusterProviderSpecificRecoveryPointDetails() + { + } + + /// Initializes a new instance of . + /// Gets the provider type. + /// Keeps track of any properties unknown to the library. + internal ClusterProviderSpecificRecoveryPointDetails(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the provider type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.Serialization.cs new file mode 100644 index 000000000000..ed34efb66d95 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.Serialization.cs @@ -0,0 +1,154 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class ClusterRecoveryPointCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterRecoveryPointCollection)} does not support writing '{format}' format."); + } + + 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); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterRecoveryPointCollection 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(ClusterRecoveryPointCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterRecoveryPointCollection(document.RootElement, options); + } + + internal static ClusterRecoveryPointCollection DeserializeClusterRecoveryPointCollection(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(ClusterRecoveryPointData.DeserializeClusterRecoveryPointData(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 ClusterRecoveryPointCollection(value ?? new ChangeTrackingList(), nextLink, 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(ClusterRecoveryPointCollection)} does not support writing '{options.Format}' format."); + } + } + + ClusterRecoveryPointCollection 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterRecoveryPointCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterRecoveryPointCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.cs new file mode 100644 index 000000000000..8db627ef1c58 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointCollection.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Collection of cluster recovery point details. + internal partial class ClusterRecoveryPointCollection + { + /// + /// 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 ClusterRecoveryPointCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The cluster recovery point details. + /// The value of next link. + /// Keeps track of any properties unknown to the library. + internal ClusterRecoveryPointCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The cluster recovery point details. + public IReadOnlyList Value { get; } + /// The value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.Serialization.cs new file mode 100644 index 000000000000..8cef3ead9a0f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.Serialization.cs @@ -0,0 +1,163 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterRecoveryPointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterRecoveryPointProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RecoveryPointOn)) + { + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn.Value, "O"); + } + if (Optional.IsDefined(RecoveryPointType)) + { + writer.WritePropertyName("recoveryPointType"u8); + writer.WriteStringValue(RecoveryPointType.Value.ToString()); + } + if (Optional.IsDefined(ProviderSpecificDetails)) + { + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterRecoveryPointProperties 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(ClusterRecoveryPointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterRecoveryPointProperties(document.RootElement, options); + } + + internal static ClusterRecoveryPointProperties DeserializeClusterRecoveryPointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? recoveryPointTime = default; + ClusterRecoveryPointType? recoveryPointType = default; + ClusterProviderSpecificRecoveryPointDetails providerSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recoveryPointType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointType = new ClusterRecoveryPointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerSpecificDetails = ClusterProviderSpecificRecoveryPointDetails.DeserializeClusterProviderSpecificRecoveryPointDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterRecoveryPointProperties(recoveryPointTime, recoveryPointType, providerSpecificDetails, 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(ClusterRecoveryPointProperties)} does not support writing '{options.Format}' format."); + } + } + + ClusterRecoveryPointProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterRecoveryPointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterRecoveryPointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.cs new file mode 100644 index 000000000000..9ff30a975419 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Cluster recovery point properties. + public partial class ClusterRecoveryPointProperties + { + /// + /// 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 ClusterRecoveryPointProperties() + { + } + + /// Initializes a new instance of . + /// The recovery point time. + /// The recovery point type. + /// + /// The provider specific details for the recovery point. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ClusterRecoveryPointProperties(DateTimeOffset? recoveryPointOn, ClusterRecoveryPointType? recoveryPointType, ClusterProviderSpecificRecoveryPointDetails providerSpecificDetails, IDictionary serializedAdditionalRawData) + { + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + ProviderSpecificDetails = providerSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The recovery point time. + public DateTimeOffset? RecoveryPointOn { get; } + /// The recovery point type. + public ClusterRecoveryPointType? RecoveryPointType { get; } + /// + /// The provider specific details for the recovery point. + /// 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 . + /// + public ClusterProviderSpecificRecoveryPointDetails ProviderSpecificDetails { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointType.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointType.cs new file mode 100644 index 000000000000..cb249c3d603f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterRecoveryPointType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// The recovery point type. + public readonly partial struct ClusterRecoveryPointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ClusterRecoveryPointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSpecifiedValue = "NotSpecified"; + private const string ApplicationConsistentValue = "ApplicationConsistent"; + private const string CrashConsistentValue = "CrashConsistent"; + + /// NotSpecified. + public static ClusterRecoveryPointType NotSpecified { get; } = new ClusterRecoveryPointType(NotSpecifiedValue); + /// ApplicationConsistent. + public static ClusterRecoveryPointType ApplicationConsistent { get; } = new ClusterRecoveryPointType(ApplicationConsistentValue); + /// CrashConsistent. + public static ClusterRecoveryPointType CrashConsistent { get; } = new ClusterRecoveryPointType(CrashConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(ClusterRecoveryPointType left, ClusterRecoveryPointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ClusterRecoveryPointType left, ClusterRecoveryPointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ClusterRecoveryPointType(string value) => new ClusterRecoveryPointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ClusterRecoveryPointType other && Equals(other); + /// + public bool Equals(ClusterRecoveryPointType 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.Serialization.cs new file mode 100644 index 000000000000..46d58ce6dbc9 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.Serialization.cs @@ -0,0 +1,136 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterSwitchProtectionJobDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterSwitchProtectionJobDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(NewReplicationProtectionClusterId)) + { + writer.WritePropertyName("newReplicationProtectionClusterId"u8); + writer.WriteStringValue(NewReplicationProtectionClusterId); + } + } + + ClusterSwitchProtectionJobDetails 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(ClusterSwitchProtectionJobDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterSwitchProtectionJobDetails(document.RootElement, options); + } + + internal static ClusterSwitchProtectionJobDetails DeserializeClusterSwitchProtectionJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string newReplicationProtectionClusterId = default; + string instanceType = default; + IReadOnlyDictionary affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("newReplicationProtectionClusterId"u8)) + { + newReplicationProtectionClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"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()); + } + affectedObjectDetails = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterSwitchProtectionJobDetails(instanceType, affectedObjectDetails ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, newReplicationProtectionClusterId); + } + + 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(ClusterSwitchProtectionJobDetails)} does not support writing '{options.Format}' format."); + } + } + + ClusterSwitchProtectionJobDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterSwitchProtectionJobDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterSwitchProtectionJobDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.cs new file mode 100644 index 000000000000..a9b2bbd76da8 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterSwitchProtectionJobDetails.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// This class represents details for switch cluster protection job. + public partial class ClusterSwitchProtectionJobDetails : SiteRecoveryJobDetails + { + /// Initializes a new instance of . + internal ClusterSwitchProtectionJobDetails() + { + InstanceType = "ClusterSwitchProtectionJobDetails"; + } + + /// Initializes a new instance of . + /// Gets the type of job details (see JobDetailsTypes enum for possible values). + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// Keeps track of any properties unknown to the library. + /// ARM Id of the new replication protection cluster. + internal ClusterSwitchProtectionJobDetails(string instanceType, IReadOnlyDictionary affectedObjectDetails, IDictionary serializedAdditionalRawData, string newReplicationProtectionClusterId) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + NewReplicationProtectionClusterId = newReplicationProtectionClusterId; + InstanceType = instanceType ?? "ClusterSwitchProtectionJobDetails"; + } + + /// ARM Id of the new replication protection cluster. + public string NewReplicationProtectionClusterId { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.Serialization.cs new file mode 100644 index 000000000000..6d7e17df1bfa --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.Serialization.cs @@ -0,0 +1,126 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterTestFailoverCleanupContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverCleanupContent)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterTestFailoverCleanupContent 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(ClusterTestFailoverCleanupContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverCleanupContent(document.RootElement, options); + } + + internal static ClusterTestFailoverCleanupContent DeserializeClusterTestFailoverCleanupContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ClusterTestFailoverCleanupContentProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ClusterTestFailoverCleanupContentProperties.DeserializeClusterTestFailoverCleanupContentProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterTestFailoverCleanupContent(properties, 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(ClusterTestFailoverCleanupContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverCleanupContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverCleanupContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverCleanupContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.cs new file mode 100644 index 000000000000..894d30750bd6 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContent.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for test failover cleanup for cluster. + public partial class ClusterTestFailoverCleanupContent + { + /// + /// 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 . + /// Test failover cleanup input properties. + /// is null. + public ClusterTestFailoverCleanupContent(ClusterTestFailoverCleanupContentProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Test failover cleanup input properties. + /// Keeps track of any properties unknown to the library. + internal ClusterTestFailoverCleanupContent(ClusterTestFailoverCleanupContentProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ClusterTestFailoverCleanupContent() + { + } + + /// Test failover cleanup input properties. + internal ClusterTestFailoverCleanupContentProperties Properties { get; } + /// Test failover cleanup comments. + public string ClusterTestFailoverCleanupContentComments + { + get => Properties?.Comments; + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.Serialization.cs new file mode 100644 index 000000000000..576e9e082e3a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.Serialization.cs @@ -0,0 +1,129 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterTestFailoverCleanupContentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverCleanupContentProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Comments)) + { + writer.WritePropertyName("comments"u8); + writer.WriteStringValue(Comments); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterTestFailoverCleanupContentProperties 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(ClusterTestFailoverCleanupContentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverCleanupContentProperties(document.RootElement, options); + } + + internal static ClusterTestFailoverCleanupContentProperties DeserializeClusterTestFailoverCleanupContentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string comments = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("comments"u8)) + { + comments = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterTestFailoverCleanupContentProperties(comments, 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(ClusterTestFailoverCleanupContentProperties)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverCleanupContentProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverCleanupContentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverCleanupContentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.cs new file mode 100644 index 000000000000..a2b8e3c0f6e5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverCleanupContentProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for test failover cleanup input properties. + public partial class ClusterTestFailoverCleanupContentProperties + { + /// + /// 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 ClusterTestFailoverCleanupContentProperties() + { + } + + /// Initializes a new instance of . + /// Test failover cleanup comments. + /// Keeps track of any properties unknown to the library. + internal ClusterTestFailoverCleanupContentProperties(string comments, IDictionary serializedAdditionalRawData) + { + Comments = comments; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Test failover cleanup comments. + public string Comments { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.Serialization.cs new file mode 100644 index 000000000000..77e34f3ebe56 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.Serialization.cs @@ -0,0 +1,126 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterTestFailoverContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverContent)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterTestFailoverContent 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(ClusterTestFailoverContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverContent(document.RootElement, options); + } + + internal static ClusterTestFailoverContent DeserializeClusterTestFailoverContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ClusterTestFailoverContentProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ClusterTestFailoverContentProperties.DeserializeClusterTestFailoverContentProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterTestFailoverContent(properties, 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(ClusterTestFailoverContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.cs new file mode 100644 index 000000000000..8519d76e2fb3 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContent.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for test cluster failover. + public partial class ClusterTestFailoverContent + { + /// + /// 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 . + /// Test failover input properties. + /// is null. + public ClusterTestFailoverContent(ClusterTestFailoverContentProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Test failover input properties. + /// Keeps track of any properties unknown to the library. + internal ClusterTestFailoverContent(ClusterTestFailoverContentProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ClusterTestFailoverContent() + { + } + + /// Test failover input properties. + public ClusterTestFailoverContentProperties Properties { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.Serialization.cs new file mode 100644 index 000000000000..942ca2590c12 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.Serialization.cs @@ -0,0 +1,174 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterTestFailoverContentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverContentProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FailoverDirection)) + { + writer.WritePropertyName("failoverDirection"u8); + writer.WriteStringValue(FailoverDirection.Value.ToString()); + } + if (Optional.IsDefined(NetworkType)) + { + writer.WritePropertyName("networkType"u8); + writer.WriteStringValue(NetworkType); + } + if (Optional.IsDefined(NetworkId)) + { + writer.WritePropertyName("networkId"u8); + writer.WriteStringValue(NetworkId); + } + if (Optional.IsDefined(ProviderSpecificDetails)) + { + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterTestFailoverContentProperties 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(ClusterTestFailoverContentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverContentProperties(document.RootElement, options); + } + + internal static ClusterTestFailoverContentProperties DeserializeClusterTestFailoverContentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FailoverDirection? failoverDirection = default; + string networkType = default; + ResourceIdentifier networkId = default; + ClusterTestFailoverProviderSpecificContent providerSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failoverDirection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failoverDirection = new FailoverDirection(property.Value.GetString()); + continue; + } + if (property.NameEquals("networkType"u8)) + { + networkType = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerSpecificDetails = ClusterTestFailoverProviderSpecificContent.DeserializeClusterTestFailoverProviderSpecificContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterTestFailoverContentProperties(failoverDirection, networkType, networkId, providerSpecificDetails, 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(ClusterTestFailoverContentProperties)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverContentProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverContentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverContentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.cs new file mode 100644 index 000000000000..cc6f4fa34549 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverContentProperties.cs @@ -0,0 +1,86 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for test failover input properties. + public partial class ClusterTestFailoverContentProperties + { + /// + /// 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 ClusterTestFailoverContentProperties() + { + } + + /// Initializes a new instance of . + /// Failover direction. + /// Network type to be used for test failover. + /// The id of the network to be used for test failover. + /// + /// Provider specific settings. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ClusterTestFailoverContentProperties(FailoverDirection? failoverDirection, string networkType, ResourceIdentifier networkId, ClusterTestFailoverProviderSpecificContent providerSpecificDetails, IDictionary serializedAdditionalRawData) + { + FailoverDirection = failoverDirection; + NetworkType = networkType; + NetworkId = networkId; + ProviderSpecificDetails = providerSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Failover direction. + public FailoverDirection? FailoverDirection { get; set; } + /// Network type to be used for test failover. + public string NetworkType { get; set; } + /// The id of the network to be used for test failover. + public ResourceIdentifier NetworkId { get; set; } + /// + /// Provider specific settings. + /// 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 . + /// + public ClusterTestFailoverProviderSpecificContent ProviderSpecificDetails { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.Serialization.cs new file mode 100644 index 000000000000..399880f12c0f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.Serialization.cs @@ -0,0 +1,214 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterTestFailoverJobDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverJobDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(TestFailoverStatus)) + { + writer.WritePropertyName("testFailoverStatus"u8); + writer.WriteStringValue(TestFailoverStatus); + } + if (Optional.IsDefined(Comments)) + { + writer.WritePropertyName("comments"u8); + writer.WriteStringValue(Comments); + } + if (Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(NetworkFriendlyName)) + { + writer.WritePropertyName("networkFriendlyName"u8); + writer.WriteStringValue(NetworkFriendlyName); + } + if (Optional.IsDefined(NetworkType)) + { + writer.WritePropertyName("networkType"u8); + writer.WriteStringValue(NetworkType); + } + if (Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + ClusterTestFailoverJobDetails 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(ClusterTestFailoverJobDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverJobDetails(document.RootElement, options); + } + + internal static ClusterTestFailoverJobDetails DeserializeClusterTestFailoverJobDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string testFailoverStatus = default; + string comments = default; + string networkName = default; + string networkFriendlyName = default; + string networkType = default; + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + IReadOnlyDictionary affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("testFailoverStatus"u8)) + { + testFailoverStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("comments"u8)) + { + comments = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkFriendlyName"u8)) + { + networkFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkType"u8)) + { + networkType = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverReplicationProtectedItemDetails.DeserializeFailoverReplicationProtectedItemDetails(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"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()); + } + affectedObjectDetails = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterTestFailoverJobDetails( + instanceType, + affectedObjectDetails ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData, + testFailoverStatus, + comments, + networkName, + networkFriendlyName, + networkType, + protectedItemDetails ?? new ChangeTrackingList()); + } + + 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(ClusterTestFailoverJobDetails)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverJobDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverJobDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverJobDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.cs new file mode 100644 index 000000000000..71084fdf7a6e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverJobDetails.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// This class represents the details for a test failover job of cluster. + public partial class ClusterTestFailoverJobDetails : SiteRecoveryJobDetails + { + /// Initializes a new instance of . + internal ClusterTestFailoverJobDetails() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "ClusterTestFailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Gets the type of job details (see JobDetailsTypes enum for possible values). + /// The affected object properties like source server, source cloud, target server, target cloud etc. based on the workflow object details. + /// Keeps track of any properties unknown to the library. + /// The test failover status. + /// The test failover comments. + /// The test network name. + /// The test network friendly name. + /// The test network type (see TestFailoverInput enum for possible values). + /// The test VM details. + internal ClusterTestFailoverJobDetails(string instanceType, IReadOnlyDictionary affectedObjectDetails, IDictionary serializedAdditionalRawData, string testFailoverStatus, string comments, string networkName, string networkFriendlyName, string networkType, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + TestFailoverStatus = testFailoverStatus; + Comments = comments; + NetworkName = networkName; + NetworkFriendlyName = networkFriendlyName; + NetworkType = networkType; + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "ClusterTestFailoverJobDetails"; + } + + /// The test failover status. + public string TestFailoverStatus { get; } + /// The test failover comments. + public string Comments { get; } + /// The test network name. + public string NetworkName { get; } + /// The test network friendly name. + public string NetworkFriendlyName { get; } + /// The test network type (see TestFailoverInput enum for possible values). + public string NetworkType { get; } + /// The test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..8e99a503aab5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownClusterTestFailoverProviderSpecificContent))] + public partial class ClusterTestFailoverProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverProviderSpecificContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterTestFailoverProviderSpecificContent 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(ClusterTestFailoverProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverProviderSpecificContent(document.RootElement, options); + } + + internal static ClusterTestFailoverProviderSpecificContent DeserializeClusterTestFailoverProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2AClusterTestFailoverContent.DeserializeA2AClusterTestFailoverContent(element, options); + } + } + return UnknownClusterTestFailoverProviderSpecificContent.DeserializeUnknownClusterTestFailoverProviderSpecificContent(element, options); + } + + 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(ClusterTestFailoverProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.cs new file mode 100644 index 000000000000..8494e15a5667 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterTestFailoverProviderSpecificContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Provider specific test cluster failover input. + /// 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 . + /// + public abstract partial class ClusterTestFailoverProviderSpecificContent + { + /// + /// 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 ClusterTestFailoverProviderSpecificContent() + { + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal ClusterTestFailoverProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.Serialization.cs new file mode 100644 index 000000000000..b9dc47f839b5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.Serialization.cs @@ -0,0 +1,126 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterUnplannedFailoverContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverContent)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterUnplannedFailoverContent 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(ClusterUnplannedFailoverContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterUnplannedFailoverContent(document.RootElement, options); + } + + internal static ClusterUnplannedFailoverContent DeserializeClusterUnplannedFailoverContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ClusterUnplannedFailoverContentProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ClusterUnplannedFailoverContentProperties.DeserializeClusterUnplannedFailoverContentProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterUnplannedFailoverContent(properties, 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(ClusterUnplannedFailoverContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterUnplannedFailoverContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterUnplannedFailoverContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.cs new file mode 100644 index 000000000000..9b1bd1314ecd --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContent.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for unplanned cluster failover. + public partial class ClusterUnplannedFailoverContent + { + /// + /// 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 . + /// Unplanned failover input properties. + /// is null. + public ClusterUnplannedFailoverContent(ClusterUnplannedFailoverContentProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Unplanned failover input properties. + /// Keeps track of any properties unknown to the library. + internal ClusterUnplannedFailoverContent(ClusterUnplannedFailoverContentProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ClusterUnplannedFailoverContent() + { + } + + /// Unplanned failover input properties. + public ClusterUnplannedFailoverContentProperties Properties { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.Serialization.cs new file mode 100644 index 000000000000..893e1310977a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.Serialization.cs @@ -0,0 +1,155 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ClusterUnplannedFailoverContentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverContentProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(FailoverDirection)) + { + writer.WritePropertyName("failoverDirection"u8); + writer.WriteStringValue(FailoverDirection); + } + if (Optional.IsDefined(SourceSiteOperations)) + { + writer.WritePropertyName("sourceSiteOperations"u8); + writer.WriteStringValue(SourceSiteOperations); + } + if (Optional.IsDefined(ProviderSpecificDetails)) + { + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterUnplannedFailoverContentProperties 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(ClusterUnplannedFailoverContentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterUnplannedFailoverContentProperties(document.RootElement, options); + } + + internal static ClusterUnplannedFailoverContentProperties DeserializeClusterUnplannedFailoverContentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string failoverDirection = default; + string sourceSiteOperations = default; + ClusterUnplannedFailoverProviderSpecificContent providerSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failoverDirection"u8)) + { + failoverDirection = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSiteOperations"u8)) + { + sourceSiteOperations = property.Value.GetString(); + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerSpecificDetails = ClusterUnplannedFailoverProviderSpecificContent.DeserializeClusterUnplannedFailoverProviderSpecificContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ClusterUnplannedFailoverContentProperties(failoverDirection, sourceSiteOperations, providerSpecificDetails, 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(ClusterUnplannedFailoverContentProperties)} does not support writing '{options.Format}' format."); + } + } + + ClusterUnplannedFailoverContentProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterUnplannedFailoverContentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverContentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.cs new file mode 100644 index 000000000000..55a35eb777fb --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverContentProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Input definition for unplanned failover input properties. + public partial class ClusterUnplannedFailoverContentProperties + { + /// + /// 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 ClusterUnplannedFailoverContentProperties() + { + } + + /// Initializes a new instance of . + /// Failover direction. + /// Source site operations status. + /// + /// Provider specific settings. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal ClusterUnplannedFailoverContentProperties(string failoverDirection, string sourceSiteOperations, ClusterUnplannedFailoverProviderSpecificContent providerSpecificDetails, IDictionary serializedAdditionalRawData) + { + FailoverDirection = failoverDirection; + SourceSiteOperations = sourceSiteOperations; + ProviderSpecificDetails = providerSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Failover direction. + public string FailoverDirection { get; set; } + /// Source site operations status. + public string SourceSiteOperations { get; set; } + /// + /// Provider specific settings. + /// 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 . + /// + public ClusterUnplannedFailoverProviderSpecificContent ProviderSpecificDetails { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..d85f626d6157 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownClusterUnplannedFailoverProviderSpecificContent))] + public partial class ClusterUnplannedFailoverProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverProviderSpecificContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ClusterUnplannedFailoverProviderSpecificContent 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(ClusterUnplannedFailoverProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterUnplannedFailoverProviderSpecificContent(document.RootElement, options); + } + + internal static ClusterUnplannedFailoverProviderSpecificContent DeserializeClusterUnplannedFailoverProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2AClusterUnplannedFailoverContent.DeserializeA2AClusterUnplannedFailoverContent(element, options); + } + } + return UnknownClusterUnplannedFailoverProviderSpecificContent.DeserializeUnknownClusterUnplannedFailoverProviderSpecificContent(element, options); + } + + 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(ClusterUnplannedFailoverProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterUnplannedFailoverProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterUnplannedFailoverProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.cs new file mode 100644 index 000000000000..e2965075d520 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ClusterUnplannedFailoverProviderSpecificContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Provider specific unplanned cluster failover input. + /// 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 . + /// + public abstract partial class ClusterUnplannedFailoverProviderSpecificContent + { + /// + /// 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 ClusterUnplannedFailoverProviderSpecificContent() + { + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal ClusterUnplannedFailoverProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The class type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/CurrentScenarioDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/CurrentScenarioDetails.cs index 58eb7d26f348..5d679b19f19c 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/CurrentScenarioDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/CurrentScenarioDetails.cs @@ -47,7 +47,7 @@ public partial class CurrentScenarioDetails private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal CurrentScenarioDetails() + public CurrentScenarioDetails() { } @@ -65,10 +65,10 @@ internal CurrentScenarioDetails(string scenarioName, ResourceIdentifier jobId, D } /// Scenario name. - public string ScenarioName { get; } + public string ScenarioName { get; set; } /// ARM Id of the job being executed. - public ResourceIdentifier JobId { get; } + public ResourceIdentifier JobId { get; set; } /// Start time of the workflow. - public DateTimeOffset? StartOn { get; } + public DateTimeOffset? StartOn { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/DiskState.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/DiskState.cs new file mode 100644 index 000000000000..b89012d67925 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/DiskState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// The disk state. + public readonly partial struct DiskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiskState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnavailableValue = "Unavailable"; + private const string InitialReplicationPendingValue = "InitialReplicationPending"; + private const string InitialReplicationFailedValue = "InitialReplicationFailed"; + private const string ProtectedValue = "Protected"; + + /// Unavailable. + public static DiskState Unavailable { get; } = new DiskState(UnavailableValue); + /// InitialReplicationPending. + public static DiskState InitialReplicationPending { get; } = new DiskState(InitialReplicationPendingValue); + /// InitialReplicationFailed. + public static DiskState InitialReplicationFailed { get; } = new DiskState(InitialReplicationFailedValue); + /// Protected. + public static DiskState Protected { get; } = new DiskState(ProtectedValue); + /// Determines if two values are the same. + public static bool operator ==(DiskState left, DiskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiskState left, DiskState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DiskState(string value) => new DiskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiskState other && Equals(other); + /// + public bool Equals(DiskState 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/FailoverDirection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/FailoverDirection.cs new file mode 100644 index 000000000000..af8185530d5e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/FailoverDirection.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Failover direction. + public readonly partial struct FailoverDirection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FailoverDirection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryToRecoveryValue = "PrimaryToRecovery"; + private const string RecoveryToPrimaryValue = "RecoveryToPrimary"; + + /// PrimaryToRecovery. + public static FailoverDirection PrimaryToRecovery { get; } = new FailoverDirection(PrimaryToRecoveryValue); + /// RecoveryToPrimary. + public static FailoverDirection RecoveryToPrimary { get; } = new FailoverDirection(RecoveryToPrimaryValue); + /// Determines if two values are the same. + public static bool operator ==(FailoverDirection left, FailoverDirection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FailoverDirection left, FailoverDirection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FailoverDirection(string value) => new FailoverDirection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FailoverDirection other && Equals(other); + /// + public bool Equals(FailoverDirection 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.Serialization.cs index d0529de3b60e..1f2543700039 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.Serialization.cs @@ -54,6 +54,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("diskEncryptionSetId"u8); writer.WriteStringValue(DiskEncryptionSetId); } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,6 +115,10 @@ internal static HyperVReplicaAzureDiskDetails DeserializeHyperVReplicaAzureDiskD ResourceIdentifier logStorageAccountId = default; SiteRecoveryDiskAccountType? diskType = default; ResourceIdentifier diskEncryptionSetId = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -131,13 +155,58 @@ internal static HyperVReplicaAzureDiskDetails DeserializeHyperVReplicaAzureDiskD diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new HyperVReplicaAzureDiskDetails(diskId, logStorageAccountId, diskType, diskEncryptionSetId, serializedAdditionalRawData); + return new HyperVReplicaAzureDiskDetails( + diskId, + logStorageAccountId, + diskType, + diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.cs index 780f24e701a3..b530f9b5baad 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureDiskDetails.cs @@ -54,15 +54,23 @@ public HyperVReplicaAzureDiskDetails() /// Initializes a new instance of . /// The DiskId. /// The LogStorageAccountId. - /// The DiskType. + /// The disk type. /// The DiskEncryptionSet ARM ID. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal HyperVReplicaAzureDiskDetails(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType? diskType, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) + internal HyperVReplicaAzureDiskDetails(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType? diskType, ResourceIdentifier diskEncryptionSetId, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; LogStorageAccountId = logStorageAccountId; DiskType = diskType; DiskEncryptionSetId = diskEncryptionSetId; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -70,9 +78,17 @@ internal HyperVReplicaAzureDiskDetails(string diskId, ResourceIdentifier logStor public string DiskId { get; set; } /// The LogStorageAccountId. public ResourceIdentifier LogStorageAccountId { get; set; } - /// The DiskType. + /// The disk type. public SiteRecoveryDiskAccountType? DiskType { get; set; } /// The DiskEncryptionSet ARM ID. public ResourceIdentifier DiskEncryptionSetId { get; set; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.Serialization.cs index e399edd398be..a12ee4136514 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.Serialization.cs @@ -50,6 +50,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("osType"u8); writer.WriteStringValue(OSType); } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } if (Optional.IsDefined(VhdId)) { writer.WritePropertyName("vhdId"u8); @@ -130,6 +135,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } + if (Optional.IsDefined(TargetVmSecurityProfile)) + { + writer.WritePropertyName("targetVmSecurityProfile"u8); + writer.WriteObjectValue(TargetVmSecurityProfile, options); + } if (Optional.IsDefined(TargetVmSize)) { writer.WritePropertyName("targetVmSize"u8); @@ -234,6 +249,7 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli string hvHostVmId = default; string vmName = default; string osType = default; + string userSelectedOSName = default; string vhdId = default; ResourceIdentifier targetStorageAccountId = default; ResourceIdentifier targetAzureNetworkId = default; @@ -249,6 +265,8 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli string targetAvailabilityZone = default; SiteRecoveryLicenseType? licenseType = default; SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; + SecurityProfileProperties targetVmSecurityProfile = default; string targetVmSize = default; ResourceIdentifier targetProximityPlacementGroupId = default; string useManagedDisksForReplication = default; @@ -279,6 +297,11 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli osType = property.Value.GetString(); continue; } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } if (property.NameEquals("vhdId"u8)) { vhdId = property.Value.GetString(); @@ -399,6 +422,24 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmSecurityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecurityProfile = SecurityProfileProperties.DeserializeSecurityProfileProperties(property.Value, options); + continue; + } if (property.NameEquals("targetVmSize"u8)) { targetVmSize = property.Value.GetString(); @@ -523,6 +564,7 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli hvHostVmId, vmName, osType, + userSelectedOSName, vhdId, targetStorageAccountId, targetAzureNetworkId, @@ -538,6 +580,8 @@ internal static HyperVReplicaAzureEnableProtectionContent DeserializeHyperVRepli targetAvailabilityZone, licenseType, sqlServerLicenseType, + linuxLicenseType, + targetVmSecurityProfile, targetVmSize, targetProximityPlacementGroupId, useManagedDisksForReplication, diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.cs index 04fd7ba1c0ed..87afdd41ec6e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureEnableProtectionContent.cs @@ -32,6 +32,7 @@ public HyperVReplicaAzureEnableProtectionContent() /// The Hyper-V host VM Id. /// The VM Name. /// The OS type associated with VM. + /// The OS name selected by user. /// The OS disk VHD id associated with VM. /// The storage account Id. /// The selected target Azure network Id. @@ -47,21 +48,24 @@ public HyperVReplicaAzureEnableProtectionContent() /// The target availability zone. /// License type. /// The SQL Server license type. + /// The license type for Linux VM's. + /// The target VM security profile. /// The target VM size. /// The proximity placement group ARM Id. /// A value indicating whether managed disks should be used during replication. - /// The DiskType. + /// The disk type. /// The disks to include list for managed disks. /// The DiskEncryptionSet ARM Id. /// The target VM tags. /// The tags for the seed managed disks. /// The tags for the target managed disks. /// The tags for the target NICs. - internal HyperVReplicaAzureEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, string hyperVHostVmId, string vmName, string osType, string vhdId, ResourceIdentifier targetStorageAccountId, ResourceIdentifier targetAzureNetworkId, ResourceIdentifier targetAzureSubnetId, string enableRdpOnTargetOption, string targetAzureVmName, ResourceIdentifier logStorageAccountId, IList disksToInclude, ResourceIdentifier targetAzureV1ResourceGroupId, ResourceIdentifier targetAzureV2ResourceGroupId, string useManagedDisks, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, string targetVmSize, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisksForReplication, SiteRecoveryDiskAccountType? diskType, IList disksToIncludeForManagedDisks, ResourceIdentifier diskEncryptionSetId, IDictionary targetVmTags, IDictionary seedManagedDiskTags, IDictionary targetManagedDiskTags, IDictionary targetNicTags) : base(instanceType, serializedAdditionalRawData) + internal HyperVReplicaAzureEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, string hyperVHostVmId, string vmName, string osType, string userSelectedOSName, string vhdId, ResourceIdentifier targetStorageAccountId, ResourceIdentifier targetAzureNetworkId, ResourceIdentifier targetAzureSubnetId, string enableRdpOnTargetOption, string targetAzureVmName, ResourceIdentifier logStorageAccountId, IList disksToInclude, ResourceIdentifier targetAzureV1ResourceGroupId, ResourceIdentifier targetAzureV2ResourceGroupId, string useManagedDisks, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, SecurityProfileProperties targetVmSecurityProfile, string targetVmSize, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisksForReplication, SiteRecoveryDiskAccountType? diskType, IList disksToIncludeForManagedDisks, ResourceIdentifier diskEncryptionSetId, IDictionary targetVmTags, IDictionary seedManagedDiskTags, IDictionary targetManagedDiskTags, IDictionary targetNicTags) : base(instanceType, serializedAdditionalRawData) { HyperVHostVmId = hyperVHostVmId; VmName = vmName; OSType = osType; + UserSelectedOSName = userSelectedOSName; VhdId = vhdId; TargetStorageAccountId = targetStorageAccountId; TargetAzureNetworkId = targetAzureNetworkId; @@ -77,6 +81,8 @@ internal HyperVReplicaAzureEnableProtectionContent(string instanceType, IDiction TargetAvailabilityZone = targetAvailabilityZone; LicenseType = licenseType; SqlServerLicenseType = sqlServerLicenseType; + LinuxLicenseType = linuxLicenseType; + TargetVmSecurityProfile = targetVmSecurityProfile; TargetVmSize = targetVmSize; TargetProximityPlacementGroupId = targetProximityPlacementGroupId; UseManagedDisksForReplication = useManagedDisksForReplication; @@ -96,6 +102,8 @@ internal HyperVReplicaAzureEnableProtectionContent(string instanceType, IDiction public string VmName { get; set; } /// The OS type associated with VM. public string OSType { get; set; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } /// The OS disk VHD id associated with VM. public string VhdId { get; set; } /// The storage account Id. @@ -126,13 +134,17 @@ internal HyperVReplicaAzureEnableProtectionContent(string instanceType, IDiction public SiteRecoveryLicenseType? LicenseType { get; set; } /// The SQL Server license type. public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } + /// The target VM security profile. + public SecurityProfileProperties TargetVmSecurityProfile { get; set; } /// The target VM size. public string TargetVmSize { get; set; } /// The proximity placement group ARM Id. public ResourceIdentifier TargetProximityPlacementGroupId { get; set; } /// A value indicating whether managed disks should be used during replication. public string UseManagedDisksForReplication { get; set; } - /// The DiskType. + /// The disk type. public SiteRecoveryDiskAccountType? DiskType { get; set; } /// The disks to include list for managed disks. public IList DisksToIncludeForManagedDisks { get; } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.Serialization.cs index 28307ce1a044..7d8a37e17af2 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.Serialization.cs @@ -54,6 +54,31 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("diskEncryptionSetId"u8); writer.WriteStringValue(DiskEncryptionSetId); } + if (Optional.IsDefined(TargetDiskAccountType)) + { + writer.WritePropertyName("targetDiskAccountType"u8); + writer.WriteStringValue(TargetDiskAccountType.Value.ToString()); + } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,6 +120,11 @@ internal static HyperVReplicaAzureManagedDiskDetails DeserializeHyperVReplicaAzu string seedManagedDiskId = default; string replicaDiskType = default; ResourceIdentifier diskEncryptionSetId = default; + SiteRecoveryDiskAccountType? targetDiskAccountType = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -123,13 +153,68 @@ internal static HyperVReplicaAzureManagedDiskDetails DeserializeHyperVReplicaAzu diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("targetDiskAccountType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetDiskAccountType = new SiteRecoveryDiskAccountType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new HyperVReplicaAzureManagedDiskDetails(diskId, seedManagedDiskId, replicaDiskType, diskEncryptionSetId, serializedAdditionalRawData); + return new HyperVReplicaAzureManagedDiskDetails( + diskId, + seedManagedDiskId, + replicaDiskType, + diskEncryptionSetId, + targetDiskAccountType, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.cs index fbceeb55e9b7..0fed15188202 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureManagedDiskDetails.cs @@ -56,13 +56,23 @@ internal HyperVReplicaAzureManagedDiskDetails() /// Seed managed disk Id. /// The replica disk type. /// The disk encryption set ARM Id. + /// The disk type. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal HyperVReplicaAzureManagedDiskDetails(string diskId, string seedManagedDiskId, string replicaDiskType, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) + internal HyperVReplicaAzureManagedDiskDetails(string diskId, string seedManagedDiskId, string replicaDiskType, ResourceIdentifier diskEncryptionSetId, SiteRecoveryDiskAccountType? targetDiskAccountType, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; SeedManagedDiskId = seedManagedDiskId; ReplicaDiskType = replicaDiskType; DiskEncryptionSetId = diskEncryptionSetId; + TargetDiskAccountType = targetDiskAccountType; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -74,5 +84,15 @@ internal HyperVReplicaAzureManagedDiskDetails(string diskId, string seedManagedD public string ReplicaDiskType { get; } /// The disk encryption set ARM Id. public ResourceIdentifier DiskEncryptionSetId { get; } + /// The disk type. + public SiteRecoveryDiskAccountType? TargetDiskAccountType { get; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.Serialization.cs index 33c4fc19ebda..c6fc622b285b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.Serialization.cs @@ -180,6 +180,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceived)) { writer.WritePropertyName("lastRecoveryPointReceived"u8); @@ -249,6 +254,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(TargetVmSecurityProfile)) + { + writer.WritePropertyName("targetVmSecurityProfile"u8); + writer.WriteObjectValue(TargetVmSecurityProfile, options); + } } HyperVReplicaAzureReplicationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -298,6 +308,7 @@ internal static HyperVReplicaAzureReplicationDetails DeserializeHyperVReplicaAzu string useManagedDisks = default; string licenseType = default; string sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; DateTimeOffset? lastRecoveryPointReceived = default; IReadOnlyDictionary targetVmTags = default; IReadOnlyDictionary seedManagedDiskTags = default; @@ -305,6 +316,7 @@ internal static HyperVReplicaAzureReplicationDetails DeserializeHyperVReplicaAzu IReadOnlyDictionary targetNicTags = default; IReadOnlyList protectedManagedDisks = default; IReadOnlyList allAvailableOSUpgradeConfigurations = default; + SecurityProfileProperties targetVmSecurityProfile = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -511,6 +523,15 @@ internal static HyperVReplicaAzureReplicationDetails DeserializeHyperVReplicaAzu sqlServerLicenseType = property.Value.GetString(); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } if (property.NameEquals("lastRecoveryPointReceived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -604,6 +625,15 @@ internal static HyperVReplicaAzureReplicationDetails DeserializeHyperVReplicaAzu allAvailableOSUpgradeConfigurations = array; continue; } + if (property.NameEquals("targetVmSecurityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecurityProfile = SecurityProfileProperties.DeserializeSecurityProfileProperties(property.Value, options); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -645,13 +675,15 @@ internal static HyperVReplicaAzureReplicationDetails DeserializeHyperVReplicaAzu useManagedDisks, licenseType, sqlServerLicenseType, + linuxLicenseType, lastRecoveryPointReceived, targetVmTags ?? new ChangeTrackingDictionary(), seedManagedDiskTags ?? new ChangeTrackingDictionary(), targetManagedDiskTags ?? new ChangeTrackingDictionary(), targetNicTags ?? new ChangeTrackingDictionary(), protectedManagedDisks ?? new ChangeTrackingList(), - allAvailableOSUpgradeConfigurations ?? new ChangeTrackingList()); + allAvailableOSUpgradeConfigurations ?? new ChangeTrackingList(), + targetVmSecurityProfile); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.cs index 2e54ec4d862a..8dab35f5c736 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureReplicationDetails.cs @@ -58,6 +58,7 @@ internal HyperVReplicaAzureReplicationDetails() /// A value indicating whether managed disks should be used during failover. /// License Type of the VM to be used. /// The SQL Server license type. + /// The license type for Linux VM's. /// The last recovery point received time. /// The target VM tags. /// The tags for the seed managed disks. @@ -65,7 +66,8 @@ internal HyperVReplicaAzureReplicationDetails() /// The tags for the target NICs. /// The list of protected managed disks. /// A value indicating all available inplace OS Upgrade configurations. - internal HyperVReplicaAzureReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IReadOnlyList vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IReadOnlyList protectedManagedDisks, IReadOnlyList allAvailableOSUpgradeConfigurations) : base(instanceType, serializedAdditionalRawData) + /// The target VM security profile. + internal HyperVReplicaAzureReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList azureVmDiskDetails, string recoveryAzureVmName, string recoveryAzureVmSize, string recoveryAzureStorageAccount, ResourceIdentifier recoveryAzureLogStorageAccountId, DateTimeOffset? lastReplicatedOn, long? rpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, string vmId, string vmProtectionState, string vmProtectionStateDescription, InitialReplicationDetails initialReplicationDetails, IReadOnlyList vmNics, ResourceIdentifier selectedRecoveryAzureNetworkId, string selectedSourceNicId, string encryption, SiteRecoveryOSDetails osDetails, int? sourceVmRamSizeInMB, int? sourceVmCpuCount, string enableRdpOnTargetOption, ResourceIdentifier recoveryAzureResourceGroupId, ResourceIdentifier recoveryAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, string useManagedDisks, string licenseType, string sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, DateTimeOffset? lastRecoveryPointReceived, IReadOnlyDictionary targetVmTags, IReadOnlyDictionary seedManagedDiskTags, IReadOnlyDictionary targetManagedDiskTags, IReadOnlyDictionary targetNicTags, IReadOnlyList protectedManagedDisks, IReadOnlyList allAvailableOSUpgradeConfigurations, SecurityProfileProperties targetVmSecurityProfile) : base(instanceType, serializedAdditionalRawData) { AzureVmDiskDetails = azureVmDiskDetails; RecoveryAzureVmName = recoveryAzureVmName; @@ -94,6 +96,7 @@ internal HyperVReplicaAzureReplicationDetails(string instanceType, IDictionary The SQL Server license type. public string SqlServerLicenseType { get; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; } /// The last recovery point received time. public DateTimeOffset? LastRecoveryPointReceived { get; } /// The target VM tags. @@ -172,5 +178,7 @@ internal HyperVReplicaAzureReplicationDetails(string instanceType, IDictionary ProtectedManagedDisks { get; } /// A value indicating all available inplace OS Upgrade configurations. public IReadOnlyList AllAvailableOSUpgradeConfigurations { get; } + /// The target VM security profile. + public SecurityProfileProperties TargetVmSecurityProfile { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.Serialization.cs index 6c97e48dd0ce..7de058e20838 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.Serialization.cs @@ -109,6 +109,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } if (Optional.IsCollectionDefined(VmDisks)) { writer.WritePropertyName("vmDisks"u8); @@ -151,6 +161,8 @@ internal static HyperVReplicaAzureUpdateReplicationProtectedItemContent Deserial IDictionary targetManagedDiskTags = default; IDictionary targetNicTags = default; SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; + string userSelectedOSName = default; IList vmDisks = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; @@ -259,6 +271,20 @@ internal static HyperVReplicaAzureUpdateReplicationProtectedItemContent Deserial sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } if (property.NameEquals("vmDisks"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -297,6 +323,8 @@ internal static HyperVReplicaAzureUpdateReplicationProtectedItemContent Deserial targetManagedDiskTags ?? new ChangeTrackingDictionary(), targetNicTags ?? new ChangeTrackingDictionary(), sqlServerLicenseType, + linuxLicenseType, + userSelectedOSName, vmDisks ?? new ChangeTrackingList()); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.cs index 3850be4c645f..13393f58f7ea 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/HyperVReplicaAzureUpdateReplicationProtectedItemContent.cs @@ -38,8 +38,10 @@ public HyperVReplicaAzureUpdateReplicationProtectedItemContent() /// The tags for the target managed disks. /// The tags for the target NICs. /// The SQL Server license type. + /// The license type for Linux VM's. + /// The OS name selected by user. /// The list of disk update properties. - internal HyperVReplicaAzureUpdateReplicationProtectedItemContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier recoveryAzureV1ResourceGroupId, ResourceIdentifier recoveryAzureV2ResourceGroupId, string useManagedDisks, IDictionary diskIdToDiskEncryptionMap, ResourceIdentifier targetProximityPlacementGroupId, string targetAvailabilityZone, IDictionary targetVmTags, IDictionary targetManagedDiskTags, IDictionary targetNicTags, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, IList vmDisks) : base(instanceType, serializedAdditionalRawData) + internal HyperVReplicaAzureUpdateReplicationProtectedItemContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier recoveryAzureV1ResourceGroupId, ResourceIdentifier recoveryAzureV2ResourceGroupId, string useManagedDisks, IDictionary diskIdToDiskEncryptionMap, ResourceIdentifier targetProximityPlacementGroupId, string targetAvailabilityZone, IDictionary targetVmTags, IDictionary targetManagedDiskTags, IDictionary targetNicTags, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, string userSelectedOSName, IList vmDisks) : base(instanceType, serializedAdditionalRawData) { RecoveryAzureV1ResourceGroupId = recoveryAzureV1ResourceGroupId; RecoveryAzureV2ResourceGroupId = recoveryAzureV2ResourceGroupId; @@ -51,6 +53,8 @@ internal HyperVReplicaAzureUpdateReplicationProtectedItemContent(string instance TargetManagedDiskTags = targetManagedDiskTags; TargetNicTags = targetNicTags; SqlServerLicenseType = sqlServerLicenseType; + LinuxLicenseType = linuxLicenseType; + UserSelectedOSName = userSelectedOSName; VmDisks = vmDisks; InstanceType = instanceType ?? "HyperVReplicaAzure"; } @@ -75,6 +79,10 @@ internal HyperVReplicaAzureUpdateReplicationProtectedItemContent(string instance public IDictionary TargetNicTags { get; } /// The SQL Server license type. public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } /// The list of disk update properties. public IList VmDisks { get; } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2DiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2DiskDetails.cs index dd34ca97e3dc..cd75fbede32b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2DiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2DiskDetails.cs @@ -54,7 +54,7 @@ public InMageAzureV2DiskDetails() /// Initializes a new instance of . /// The DiskId. /// The LogStorageAccountId. - /// The DiskType. + /// The disk type. /// The DiskEncryptionSet ARM ID. /// Keeps track of any properties unknown to the library. internal InMageAzureV2DiskDetails(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType? diskType, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) @@ -70,7 +70,7 @@ internal InMageAzureV2DiskDetails(string diskId, ResourceIdentifier logStorageAc public string DiskId { get; set; } /// The LogStorageAccountId. public ResourceIdentifier LogStorageAccountId { get; set; } - /// The DiskType. + /// The disk type. public SiteRecoveryDiskAccountType? DiskType { get; set; } /// The DiskEncryptionSet ARM ID. public ResourceIdentifier DiskEncryptionSetId { get; set; } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2EnableProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2EnableProtectionContent.cs index 0053d6c8850b..1ed1a0414da4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2EnableProtectionContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageAzureV2EnableProtectionContent.cs @@ -42,7 +42,7 @@ public InMageAzureV2EnableProtectionContent() /// The storage account to be used for logging during replication. /// The Id of the target resource group (for classic deployment) in which the failover VM is to be created. /// The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. - /// The DiskType. + /// The disk type. /// The target availability set ARM Id for resource manager deployment. /// The target availability zone. /// The proximity placement group ARM Id. @@ -113,7 +113,7 @@ internal InMageAzureV2EnableProtectionContent(string instanceType, IDictionary The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. public ResourceIdentifier TargetAzureV2ResourceGroupId { get; set; } - /// The DiskType. + /// The disk type. public SiteRecoveryDiskAccountType? DiskType { get; set; } /// The target availability set ARM Id for resource manager deployment. public ResourceIdentifier TargetAvailabilitySetId { get; set; } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.Serialization.cs new file mode 100644 index 000000000000..61c664a0e006 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.Serialization.cs @@ -0,0 +1,128 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class InMageRcmAddDisksContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InMageRcmAddDisksContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("disks"u8); + writer.WriteStartArray(); + foreach (var item in Disks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + InMageRcmAddDisksContent 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(InMageRcmAddDisksContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInMageRcmAddDisksContent(document.RootElement, options); + } + + internal static InMageRcmAddDisksContent DeserializeInMageRcmAddDisksContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList disks = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InMageRcmDiskContent.DeserializeInMageRcmDiskContent(item, options)); + } + disks = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InMageRcmAddDisksContent(instanceType, serializedAdditionalRawData, disks); + } + + 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(InMageRcmAddDisksContent)} does not support writing '{options.Format}' format."); + } + } + + InMageRcmAddDisksContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInMageRcmAddDisksContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InMageRcmAddDisksContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.cs new file mode 100644 index 000000000000..8d3cafcb24fc --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmAddDisksContent.cs @@ -0,0 +1,46 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// InMageRcm add disk(s) input. + public partial class InMageRcmAddDisksContent : SiteRecoveryAddDisksProviderSpecificContent + { + /// Initializes a new instance of . + /// The list of disk details. + /// is null. + public InMageRcmAddDisksContent(IEnumerable disks) + { + Argument.AssertNotNull(disks, nameof(disks)); + + Disks = disks.ToList(); + InstanceType = "InMageRcm"; + } + + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + /// The list of disk details. + internal InMageRcmAddDisksContent(string instanceType, IDictionary serializedAdditionalRawData, IList disks) : base(instanceType, serializedAdditionalRawData) + { + Disks = disks; + InstanceType = instanceType ?? "InMageRcm"; + } + + /// Initializes a new instance of for deserialization. + internal InMageRcmAddDisksContent() + { + } + + /// The list of disk details. + public IList Disks { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.Serialization.cs index 8e046534f7a6..a7c1fb92f02b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.Serialization.cs @@ -45,6 +45,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("diskEncryptionSetId"u8); writer.WriteStringValue(DiskEncryptionSetId); } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,6 +106,10 @@ internal static InMageRcmDiskContent DeserializeInMageRcmDiskContent(JsonElement ResourceIdentifier logStorageAccountId = default; SiteRecoveryDiskAccountType diskType = default; ResourceIdentifier diskEncryptionSetId = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -114,13 +138,58 @@ internal static InMageRcmDiskContent DeserializeInMageRcmDiskContent(JsonElement diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InMageRcmDiskContent(diskId, logStorageAccountId, diskType, diskEncryptionSetId, serializedAdditionalRawData); + return new InMageRcmDiskContent( + diskId, + logStorageAccountId, + diskType, + diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.cs index bd6fea2255a3..88922db12a14 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDiskContent.cs @@ -66,13 +66,21 @@ public InMageRcmDiskContent(string diskId, ResourceIdentifier logStorageAccountI /// The log storage account ARM Id. /// The disk type. /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal InMageRcmDiskContent(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) + internal InMageRcmDiskContent(string diskId, ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; LogStorageAccountId = logStorageAccountId; DiskType = diskType; DiskEncryptionSetId = diskEncryptionSetId; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -89,5 +97,13 @@ internal InMageRcmDiskContent() public SiteRecoveryDiskAccountType DiskType { get; } /// The DiskEncryptionSet ARM Id. public ResourceIdentifier DiskEncryptionSetId { get; set; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.Serialization.cs index e4102e542555..0b0a786ca356 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.Serialization.cs @@ -43,6 +43,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("diskEncryptionSetId"u8); writer.WriteStringValue(DiskEncryptionSetId); } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -83,6 +103,10 @@ internal static InMageRcmDisksDefaultContent DeserializeInMageRcmDisksDefaultCon ResourceIdentifier logStorageAccountId = default; SiteRecoveryDiskAccountType diskType = default; ResourceIdentifier diskEncryptionSetId = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -106,13 +130,57 @@ internal static InMageRcmDisksDefaultContent DeserializeInMageRcmDisksDefaultCon diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new InMageRcmDisksDefaultContent(logStorageAccountId, diskType, diskEncryptionSetId, serializedAdditionalRawData); + return new InMageRcmDisksDefaultContent( + logStorageAccountId, + diskType, + diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.cs index 9bb2a550d522..3c6ad3ac24b7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmDisksDefaultContent.cs @@ -62,12 +62,20 @@ public InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId, Site /// The log storage account ARM Id. /// The disk type. /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) + internal InMageRcmDisksDefaultContent(ResourceIdentifier logStorageAccountId, SiteRecoveryDiskAccountType diskType, ResourceIdentifier diskEncryptionSetId, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { LogStorageAccountId = logStorageAccountId; DiskType = diskType; DiskEncryptionSetId = diskEncryptionSetId; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,5 +90,13 @@ internal InMageRcmDisksDefaultContent() public SiteRecoveryDiskAccountType DiskType { get; } /// The DiskEncryptionSet ARM Id. public ResourceIdentifier DiskEncryptionSetId { get; set; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.Serialization.cs index 8a54a282cd17..69da95004c66 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.Serialization.cs @@ -121,6 +121,66 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("multiVmGroupName"u8); writer.WriteStringValue(MultiVmGroupName); } + if (Optional.IsDefined(SqlServerLicenseType)) + { + writer.WritePropertyName("sqlServerLicenseType"u8); + writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); + } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } + if (Optional.IsCollectionDefined(TargetVmTags)) + { + writer.WritePropertyName("targetVmTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetVmTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SeedManagedDiskTags)) + { + writer.WritePropertyName("seedManagedDiskTags"u8); + writer.WriteStartArray(); + foreach (var item in SeedManagedDiskTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetManagedDiskTags)) + { + writer.WritePropertyName("targetManagedDiskTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetManagedDiskTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetNicTags)) + { + writer.WritePropertyName("targetNicTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetNicTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } + if (Optional.IsDefined(TargetVmSecurityProfile)) + { + writer.WritePropertyName("targetVmSecurityProfile"u8); + writer.WriteObjectValue(TargetVmSecurityProfile, options); + } } InMageRcmEnableProtectionContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -161,6 +221,14 @@ internal static InMageRcmEnableProtectionContent DeserializeInMageRcmEnableProte string runAsAccountId = default; Guid processServerId = default; string multiVmGroupName = default; + SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; + IList targetVmTags = default; + IList seedManagedDiskTags = default; + IList targetManagedDiskTags = default; + IList targetNicTags = default; + string userSelectedOSName = default; + SecurityProfileProperties targetVmSecurityProfile = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -293,6 +361,94 @@ internal static InMageRcmEnableProtectionContent DeserializeInMageRcmEnableProte multiVmGroupName = property.Value.GetString(); continue; } + if (property.NameEquals("sqlServerLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetVmTags = array; + continue; + } + if (property.NameEquals("seedManagedDiskTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + seedManagedDiskTags = array; + continue; + } + if (property.NameEquals("targetManagedDiskTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetManagedDiskTags = array; + continue; + } + if (property.NameEquals("targetNicTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetNicTags = array; + continue; + } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmSecurityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecurityProfile = SecurityProfileProperties.DeserializeSecurityProfileProperties(property.Value, options); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -324,7 +480,15 @@ internal static InMageRcmEnableProtectionContent DeserializeInMageRcmEnableProte targetBootDiagnosticsStorageAccountId, runAsAccountId, processServerId, - multiVmGroupName); + multiVmGroupName, + sqlServerLicenseType, + linuxLicenseType, + targetVmTags ?? new ChangeTrackingList(), + seedManagedDiskTags ?? new ChangeTrackingList(), + targetManagedDiskTags ?? new ChangeTrackingList(), + targetNicTags ?? new ChangeTrackingList(), + userSelectedOSName, + targetVmSecurityProfile); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.cs index dfea19e91b76..9d1997452cf8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmEnableProtectionContent.cs @@ -28,6 +28,10 @@ public InMageRcmEnableProtectionContent(string fabricDiscoveryMachineId, Resourc DisksToInclude = new ChangeTrackingList(); TargetResourceGroupId = targetResourceGroupId; ProcessServerId = processServerId; + TargetVmTags = new ChangeTrackingList(); + SeedManagedDiskTags = new ChangeTrackingList(); + TargetManagedDiskTags = new ChangeTrackingList(); + TargetNicTags = new ChangeTrackingList(); InstanceType = "InMageRcm"; } @@ -52,7 +56,15 @@ public InMageRcmEnableProtectionContent(string fabricDiscoveryMachineId, Resourc /// The run-as account Id. /// The process server Id. /// The multi VM group name. - internal InMageRcmEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, string fabricDiscoveryMachineId, IList disksToInclude, InMageRcmDisksDefaultContent disksDefault, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, string targetVmName, string targetVmSize, SiteRecoveryLicenseType? licenseType, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string runAsAccountId, Guid processServerId, string multiVmGroupName) : base(instanceType, serializedAdditionalRawData) + /// The SQL Server license type. + /// The license type for Linux VM's. + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The OS name selected by user. + /// The target VM security profile. + internal InMageRcmEnableProtectionContent(string instanceType, IDictionary serializedAdditionalRawData, string fabricDiscoveryMachineId, IList disksToInclude, InMageRcmDisksDefaultContent disksDefault, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, string targetVmName, string targetVmSize, SiteRecoveryLicenseType? licenseType, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string runAsAccountId, Guid processServerId, string multiVmGroupName, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, IList targetVmTags, IList seedManagedDiskTags, IList targetManagedDiskTags, IList targetNicTags, string userSelectedOSName, SecurityProfileProperties targetVmSecurityProfile) : base(instanceType, serializedAdditionalRawData) { FabricDiscoveryMachineId = fabricDiscoveryMachineId; DisksToInclude = disksToInclude; @@ -72,6 +84,14 @@ internal InMageRcmEnableProtectionContent(string instanceType, IDictionary The multi VM group name. public string MultiVmGroupName { get; set; } + /// The SQL Server license type. + public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } + /// The target VM tags. + public IList TargetVmTags { get; } + /// The tags for the seed managed disks. + public IList SeedManagedDiskTags { get; } + /// The tags for the target managed disks. + public IList TargetManagedDiskTags { get; } + /// The tags for the target NICs. + public IList TargetNicTags { get; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } + /// The target VM security profile. + public SecurityProfileProperties TargetVmSecurityProfile { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.Serialization.cs index e771754fe4ee..551c74ab196e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.Serialization.cs @@ -64,6 +64,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("testStaticIPAddress"u8); writer.WriteStringValue(TestStaticIPAddress.ToString()); } + if (Optional.IsDefined(TargetNicName)) + { + writer.WritePropertyName("targetNicName"u8); + writer.WriteStringValue(TargetNicName); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -108,6 +113,7 @@ internal static InMageRcmNicContent DeserializeInMageRcmNicContent(JsonElement e IPAddress targetStaticIPAddress = default; string testSubnetName = default; IPAddress testStaticIPAddress = default; + string targetNicName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -155,6 +161,11 @@ internal static InMageRcmNicContent DeserializeInMageRcmNicContent(JsonElement e testStaticIPAddress = IPAddress.Parse(property.Value.GetString()); continue; } + if (property.NameEquals("targetNicName"u8)) + { + targetNicName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -169,6 +180,7 @@ internal static InMageRcmNicContent DeserializeInMageRcmNicContent(JsonElement e targetStaticIPAddress, testSubnetName, testStaticIPAddress, + targetNicName, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.cs index 8dbb9ae2c70b..a6f223c907c3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicContent.cs @@ -67,8 +67,9 @@ public InMageRcmNicContent(string nicId, string isPrimaryNic) /// The target static IP address. /// The test subnet name. /// The test static IP address. + /// The target NIC name. /// Keeps track of any properties unknown to the library. - internal InMageRcmNicContent(string nicId, string isPrimaryNic, string isSelectedForFailover, string targetSubnetName, IPAddress targetStaticIPAddress, string testSubnetName, IPAddress testStaticIPAddress, IDictionary serializedAdditionalRawData) + internal InMageRcmNicContent(string nicId, string isPrimaryNic, string isSelectedForFailover, string targetSubnetName, IPAddress targetStaticIPAddress, string testSubnetName, IPAddress testStaticIPAddress, string targetNicName, IDictionary serializedAdditionalRawData) { NicId = nicId; IsPrimaryNic = isPrimaryNic; @@ -77,6 +78,7 @@ internal InMageRcmNicContent(string nicId, string isPrimaryNic, string isSelecte TargetStaticIPAddress = targetStaticIPAddress; TestSubnetName = testSubnetName; TestStaticIPAddress = testStaticIPAddress; + TargetNicName = targetNicName; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -99,5 +101,7 @@ internal InMageRcmNicContent() public string TestSubnetName { get; set; } /// The test static IP address. public IPAddress TestStaticIPAddress { get; set; } + /// The target NIC name. + public string TargetNicName { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.Serialization.cs index 18e55270dca6..6779fdd43879 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.Serialization.cs @@ -100,6 +100,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("testIPAddressType"u8); writer.WriteStringValue(TestIPAddressType.Value.ToString()); } + if (Optional.IsDefined(TargetNicName)) + { + writer.WritePropertyName("targetNicName"u8); + writer.WriteStringValue(TargetNicName); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -150,6 +155,7 @@ internal static InMageRcmNicDetails DeserializeInMageRcmNicDetails(JsonElement e string testSubnetName = default; IPAddress testIPAddress = default; SiteRecoveryEthernetAddressType? testIPAddressType = default; + string targetNicName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -247,6 +253,11 @@ internal static InMageRcmNicDetails DeserializeInMageRcmNicDetails(JsonElement e testIPAddressType = new SiteRecoveryEthernetAddressType(property.Value.GetString()); continue; } + if (property.NameEquals("targetNicName"u8)) + { + targetNicName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -267,6 +278,7 @@ internal static InMageRcmNicDetails DeserializeInMageRcmNicDetails(JsonElement e testSubnetName, testIPAddress, testIPAddressType, + targetNicName, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.cs index 60beea28acbe..412d624a137d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmNicDetails.cs @@ -66,8 +66,9 @@ internal InMageRcmNicDetails() /// Test subnet name. /// The test IP address. /// The test IP address type. + /// The target NIC name. /// Keeps track of any properties unknown to the library. - internal InMageRcmNicDetails(string nicId, string isPrimaryNic, string isSelectedForFailover, IPAddress sourceIPAddress, SiteRecoveryEthernetAddressType? sourceIPAddressType, ResourceIdentifier sourceNetworkId, string sourceSubnetName, IPAddress targetIPAddress, SiteRecoveryEthernetAddressType? targetIPAddressType, string targetSubnetName, string testSubnetName, IPAddress testIPAddress, SiteRecoveryEthernetAddressType? testIPAddressType, IDictionary serializedAdditionalRawData) + internal InMageRcmNicDetails(string nicId, string isPrimaryNic, string isSelectedForFailover, IPAddress sourceIPAddress, SiteRecoveryEthernetAddressType? sourceIPAddressType, ResourceIdentifier sourceNetworkId, string sourceSubnetName, IPAddress targetIPAddress, SiteRecoveryEthernetAddressType? targetIPAddressType, string targetSubnetName, string testSubnetName, IPAddress testIPAddress, SiteRecoveryEthernetAddressType? testIPAddressType, string targetNicName, IDictionary serializedAdditionalRawData) { NicId = nicId; IsPrimaryNic = isPrimaryNic; @@ -82,6 +83,7 @@ internal InMageRcmNicDetails(string nicId, string isPrimaryNic, string isSelecte TestSubnetName = testSubnetName; TestIPAddress = testIPAddress; TestIPAddressType = testIPAddressType; + TargetNicName = targetNicName; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -111,5 +113,7 @@ internal InMageRcmNicDetails(string nicId, string isPrimaryNic, string isSelecte public IPAddress TestIPAddress { get; } /// The test IP address type. public SiteRecoveryEthernetAddressType? TestIPAddressType { get; } + /// The target NIC name. + public string TargetNicName { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.Serialization.cs index be9e64a6a30d..d50ee986b73b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.Serialization.cs @@ -54,6 +54,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("capacityInBytes"u8); writer.WriteNumberValue(CapacityInBytes.Value); } + if (options.Format != "W" && Optional.IsDefined(DiskState)) + { + writer.WritePropertyName("diskState"u8); + writer.WriteStringValue(DiskState.Value.ToString()); + } if (options.Format != "W" && Optional.IsDefined(LogStorageAccountId)) { writer.WritePropertyName("logStorageAccountId"u8); @@ -109,6 +114,31 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resyncDetails"u8); writer.WriteObjectValue(ResyncDetails, options); } + if (Optional.IsDefined(CustomTargetDiskName)) + { + writer.WritePropertyName("customTargetDiskName"u8); + writer.WriteStringValue(CustomTargetDiskName); + } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -150,6 +180,7 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD string diskName = default; string isOSDisk = default; long? capacityInBytes = default; + DiskState? diskState = default; ResourceIdentifier logStorageAccountId = default; ResourceIdentifier diskEncryptionSetId = default; string seedManagedDiskId = default; @@ -161,6 +192,11 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD string isInitialReplicationComplete = default; InMageRcmSyncDetails irDetails = default; InMageRcmSyncDetails resyncDetails = default; + string customTargetDiskName = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -189,6 +225,15 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD capacityInBytes = property.Value.GetInt64(); continue; } + if (property.NameEquals("diskState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskState = new DiskState(property.Value.GetString()); + continue; + } if (property.NameEquals("logStorageAccountId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -276,6 +321,47 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD resyncDetails = InMageRcmSyncDetails.DeserializeInMageRcmSyncDetails(property.Value, options); continue; } + if (property.NameEquals("customTargetDiskName"u8)) + { + customTargetDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -287,6 +373,7 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD diskName, isOSDisk, capacityInBytes, + diskState, logStorageAccountId, diskEncryptionSetId, seedManagedDiskId, @@ -298,6 +385,11 @@ internal static InMageRcmProtectedDiskDetails DeserializeInMageRcmProtectedDiskD isInitialReplicationComplete, irDetails, resyncDetails, + customTargetDiskName, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.cs index dddb934a31e3..6266f55c341e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmProtectedDiskDetails.cs @@ -56,6 +56,7 @@ internal InMageRcmProtectedDiskDetails() /// The disk name. /// A value indicating whether the disk is the OS disk. /// The disk capacity in bytes. + /// The disk state. /// The log storage account ARM Id. /// The DiskEncryptionSet ARM Id. /// The ARM Id of the seed managed disk. @@ -67,13 +68,19 @@ internal InMageRcmProtectedDiskDetails() /// A value indicating whether initial replication is complete or not. /// The initial replication details. /// The resync details. + /// The custom target Azure disk name. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal InMageRcmProtectedDiskDetails(string diskId, string diskName, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, SiteRecoveryDiskAccountType? diskType, double? dataPendingInLogDataStoreInMB, double? dataPendingAtSourceAgentInMB, string isInitialReplicationComplete, InMageRcmSyncDetails irDetails, InMageRcmSyncDetails resyncDetails, IDictionary serializedAdditionalRawData) + internal InMageRcmProtectedDiskDetails(string diskId, string diskName, string isOSDisk, long? capacityInBytes, DiskState? diskState, ResourceIdentifier logStorageAccountId, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, SiteRecoveryDiskAccountType? diskType, double? dataPendingInLogDataStoreInMB, double? dataPendingAtSourceAgentInMB, string isInitialReplicationComplete, InMageRcmSyncDetails irDetails, InMageRcmSyncDetails resyncDetails, string customTargetDiskName, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; DiskName = diskName; IsOSDisk = isOSDisk; CapacityInBytes = capacityInBytes; + DiskState = diskState; LogStorageAccountId = logStorageAccountId; DiskEncryptionSetId = diskEncryptionSetId; SeedManagedDiskId = seedManagedDiskId; @@ -85,6 +92,11 @@ internal InMageRcmProtectedDiskDetails(string diskId, string diskName, string is IsInitialReplicationComplete = isInitialReplicationComplete; IrDetails = irDetails; ResyncDetails = resyncDetails; + CustomTargetDiskName = customTargetDiskName; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -96,6 +108,8 @@ internal InMageRcmProtectedDiskDetails(string diskId, string diskName, string is public string IsOSDisk { get; } /// The disk capacity in bytes. public long? CapacityInBytes { get; } + /// The disk state. + public DiskState? DiskState { get; } /// The log storage account ARM Id. public ResourceIdentifier LogStorageAccountId { get; } /// The DiskEncryptionSet ARM Id. @@ -118,5 +132,15 @@ internal InMageRcmProtectedDiskDetails(string diskId, string diskName, string is public InMageRcmSyncDetails IrDetails { get; } /// The resync details. public InMageRcmSyncDetails ResyncDetails { get; } + /// The custom target Azure disk name. + public string CustomTargetDiskName { get; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.Serialization.cs index 9ccff3bef60c..b23a7dcdf23b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.Serialization.cs @@ -106,6 +106,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("licenseType"u8); writer.WriteStringValue(LicenseType); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } if (options.Format != "W" && Optional.IsDefined(StorageAccountId)) { writer.WritePropertyName("storageAccountId"u8); @@ -266,6 +271,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(UnprotectedDisks)) + { + writer.WritePropertyName("unprotectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in UnprotectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && Optional.IsDefined(IsLastUpgradeSuccessful)) { writer.WritePropertyName("isLastUpgradeSuccessful"u8); @@ -316,6 +331,71 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("discoveredVmDetails"u8); writer.WriteObjectValue(DiscoveredVmDetails, options); } + if (Optional.IsCollectionDefined(TargetVmTags)) + { + writer.WritePropertyName("targetVmTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetVmTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SeedManagedDiskTags)) + { + writer.WritePropertyName("seedManagedDiskTags"u8); + writer.WriteStartArray(); + foreach (var item in SeedManagedDiskTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetManagedDiskTags)) + { + writer.WritePropertyName("targetManagedDiskTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetManagedDiskTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetNicTags)) + { + writer.WritePropertyName("targetNicTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetNicTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SqlServerLicenseType)) + { + writer.WritePropertyName("sqlServerLicenseType"u8); + writer.WriteStringValue(SqlServerLicenseType); + } + if (Optional.IsCollectionDefined(SupportedOSVersions)) + { + writer.WritePropertyName("supportedOSVersions"u8); + writer.WriteStartArray(); + foreach (var item in SupportedOSVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (Optional.IsDefined(TargetVmSecurityProfile)) + { + writer.WritePropertyName("targetVmSecurityProfile"u8); + writer.WriteObjectValue(TargetVmSecurityProfile, options); + } } InMageRcmReplicationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -352,6 +432,7 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai IPAddress primaryNicIPAddress = default; string targetGeneration = default; string licenseType = default; + LinuxLicenseType? linuxLicenseType = default; ResourceIdentifier storageAccountId = default; string targetVmName = default; string targetVmSize = default; @@ -383,6 +464,7 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai string agentUpgradeJobId = default; string agentUpgradeAttemptToVersion = default; IReadOnlyList protectedDisks = default; + IReadOnlyList unprotectedDisks = default; string isLastUpgradeSuccessful = default; bool? isAgentRegistrationSuccessfulAfterFailover = default; InMageRcmMobilityAgentDetails mobilityAgentDetails = default; @@ -390,6 +472,14 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai IReadOnlyList agentUpgradeBlockingErrorDetails = default; IReadOnlyList vmNics = default; InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails = default; + IReadOnlyList targetVmTags = default; + IReadOnlyList seedManagedDiskTags = default; + IReadOnlyList targetManagedDiskTags = default; + IReadOnlyList targetNicTags = default; + string sqlServerLicenseType = default; + IReadOnlyList supportedOSVersions = default; + string osName = default; + SecurityProfileProperties targetVmSecurityProfile = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -481,6 +571,15 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai licenseType = property.Value.GetString(); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } if (property.NameEquals("storageAccountId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -733,6 +832,20 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai protectedDisks = array; continue; } + if (property.NameEquals("unprotectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InMageRcmUnProtectedDiskDetails.DeserializeInMageRcmUnProtectedDiskDetails(item, options)); + } + unprotectedDisks = array; + continue; + } if (property.NameEquals("isLastUpgradeSuccessful"u8)) { isLastUpgradeSuccessful = property.Value.GetString(); @@ -807,6 +920,95 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai discoveredVmDetails = InMageRcmDiscoveredProtectedVmDetails.DeserializeInMageRcmDiscoveredProtectedVmDetails(property.Value, options); continue; } + if (property.NameEquals("targetVmTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetVmTags = array; + continue; + } + if (property.NameEquals("seedManagedDiskTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + seedManagedDiskTags = array; + continue; + } + if (property.NameEquals("targetManagedDiskTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetManagedDiskTags = array; + continue; + } + if (property.NameEquals("targetNicTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetNicTags = array; + continue; + } + if (property.NameEquals("sqlServerLicenseType"u8)) + { + sqlServerLicenseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedOSVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedOSVersions = array; + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmSecurityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecurityProfile = SecurityProfileProperties.DeserializeSecurityProfileProperties(property.Value, options); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -835,6 +1037,7 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai primaryNicIPAddress, targetGeneration, licenseType, + linuxLicenseType, storageAccountId, targetVmName, targetVmSize, @@ -866,13 +1069,22 @@ internal static InMageRcmReplicationDetails DeserializeInMageRcmReplicationDetai agentUpgradeJobId, agentUpgradeAttemptToVersion, protectedDisks ?? new ChangeTrackingList(), + unprotectedDisks ?? new ChangeTrackingList(), isLastUpgradeSuccessful, isAgentRegistrationSuccessfulAfterFailover, mobilityAgentDetails, lastAgentUpgradeErrorDetails ?? new ChangeTrackingList(), agentUpgradeBlockingErrorDetails ?? new ChangeTrackingList(), vmNics ?? new ChangeTrackingList(), - discoveredVmDetails); + discoveredVmDetails, + targetVmTags ?? new ChangeTrackingList(), + seedManagedDiskTags ?? new ChangeTrackingList(), + targetManagedDiskTags ?? new ChangeTrackingList(), + targetNicTags ?? new ChangeTrackingList(), + sqlServerLicenseType, + supportedOSVersions ?? new ChangeTrackingList(), + osName, + targetVmSecurityProfile); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.cs index 847fff30c14a..e43dec1df21f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmReplicationDetails.cs @@ -19,9 +19,15 @@ public partial class InMageRcmReplicationDetails : ReplicationProviderSpecificSe internal InMageRcmReplicationDetails() { ProtectedDisks = new ChangeTrackingList(); + UnprotectedDisks = new ChangeTrackingList(); LastAgentUpgradeErrorDetails = new ChangeTrackingList(); AgentUpgradeBlockingErrorDetails = new ChangeTrackingList(); VmNics = new ChangeTrackingList(); + TargetVmTags = new ChangeTrackingList(); + SeedManagedDiskTags = new ChangeTrackingList(); + TargetManagedDiskTags = new ChangeTrackingList(); + TargetNicTags = new ChangeTrackingList(); + SupportedOSVersions = new ChangeTrackingList(); InstanceType = "InMageRcm"; } @@ -42,6 +48,7 @@ internal InMageRcmReplicationDetails() /// The IP address of the primary network interface. /// The target generation. /// License Type of the VM to be used. + /// The license type for Linux VM's. /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. /// Target VM name. /// The target VM size. @@ -73,6 +80,7 @@ internal InMageRcmReplicationDetails() /// The agent upgrade job Id. /// The agent version to which last agent upgrade was attempted. /// The list of protected disks. + /// The list of unprotected disks. /// A value indicating whether last agent upgrade was successful or not. /// A value indicating whether agent registration was successful after failover. /// The mobility agent information. @@ -80,7 +88,15 @@ internal InMageRcmReplicationDetails() /// The agent upgrade blocking error information. /// The network details. /// The discovered VM details. - internal InMageRcmReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, string internalIdentifier, string fabricDiscoveryMachineId, string multiVmGroupName, string discoveryType, Guid? processServerId, int? processorCoreCount, double? allocatedMemoryInMB, string processServerName, string runAsAccountId, string osType, string firmwareType, IPAddress primaryNicIPAddress, string targetGeneration, string licenseType, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, string targetLocation, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, ResourceIdentifier failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, long? lastRpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, ResourceIdentifier lastRecoveryPointId, int? initialReplicationProgressPercentage, long? initialReplicationProcessedBytes, long? initialReplicationTransferredBytes, VmReplicationProgressHealth? initialReplicationProgressHealth, int? resyncProgressPercentage, long? resyncProcessedBytes, long? resyncTransferredBytes, VmReplicationProgressHealth? resyncProgressHealth, string resyncRequired, SiteRecoveryResyncState? resyncState, MobilityAgentUpgradeState? agentUpgradeState, string lastAgentUpgradeType, string agentUpgradeJobId, string agentUpgradeAttemptToVersion, IReadOnlyList protectedDisks, string isLastUpgradeSuccessful, bool? isAgentRegistrationSuccessfulAfterFailover, InMageRcmMobilityAgentDetails mobilityAgentDetails, IReadOnlyList lastAgentUpgradeErrorDetails, IReadOnlyList agentUpgradeBlockingErrorDetails, IReadOnlyList vmNics, InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails) : base(instanceType, serializedAdditionalRawData) + /// The target VM tags. + /// The tags for the seed managed disks. + /// The tags for the target managed disks. + /// The tags for the target NICs. + /// The SQL Server license type. + /// A value indicating the inplace OS Upgrade version. + /// The OS name associated with VM. + /// The target VM security profile. + internal InMageRcmReplicationDetails(string instanceType, IDictionary serializedAdditionalRawData, string internalIdentifier, string fabricDiscoveryMachineId, string multiVmGroupName, string discoveryType, Guid? processServerId, int? processorCoreCount, double? allocatedMemoryInMB, string processServerName, string runAsAccountId, string osType, string firmwareType, IPAddress primaryNicIPAddress, string targetGeneration, string licenseType, LinuxLicenseType? linuxLicenseType, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, string targetLocation, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, ResourceIdentifier failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, long? lastRpoInSeconds, DateTimeOffset? lastRpoCalculatedOn, ResourceIdentifier lastRecoveryPointId, int? initialReplicationProgressPercentage, long? initialReplicationProcessedBytes, long? initialReplicationTransferredBytes, VmReplicationProgressHealth? initialReplicationProgressHealth, int? resyncProgressPercentage, long? resyncProcessedBytes, long? resyncTransferredBytes, VmReplicationProgressHealth? resyncProgressHealth, string resyncRequired, SiteRecoveryResyncState? resyncState, MobilityAgentUpgradeState? agentUpgradeState, string lastAgentUpgradeType, string agentUpgradeJobId, string agentUpgradeAttemptToVersion, IReadOnlyList protectedDisks, IReadOnlyList unprotectedDisks, string isLastUpgradeSuccessful, bool? isAgentRegistrationSuccessfulAfterFailover, InMageRcmMobilityAgentDetails mobilityAgentDetails, IReadOnlyList lastAgentUpgradeErrorDetails, IReadOnlyList agentUpgradeBlockingErrorDetails, IReadOnlyList vmNics, InMageRcmDiscoveredProtectedVmDetails discoveredVmDetails, IReadOnlyList targetVmTags, IReadOnlyList seedManagedDiskTags, IReadOnlyList targetManagedDiskTags, IReadOnlyList targetNicTags, string sqlServerLicenseType, IReadOnlyList supportedOSVersions, string osName, SecurityProfileProperties targetVmSecurityProfile) : base(instanceType, serializedAdditionalRawData) { InternalIdentifier = internalIdentifier; FabricDiscoveryMachineId = fabricDiscoveryMachineId; @@ -96,6 +112,7 @@ internal InMageRcmReplicationDetails(string instanceType, IDictionary License Type of the VM to be used. public string LicenseType { get; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; } /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. public ResourceIdentifier StorageAccountId { get; } /// Target VM name. @@ -227,6 +255,8 @@ internal InMageRcmReplicationDetails(string instanceType, IDictionary The list of protected disks. public IReadOnlyList ProtectedDisks { get; } + /// The list of unprotected disks. + public IReadOnlyList UnprotectedDisks { get; } /// A value indicating whether last agent upgrade was successful or not. public string IsLastUpgradeSuccessful { get; } /// A value indicating whether agent registration was successful after failover. @@ -241,5 +271,21 @@ internal InMageRcmReplicationDetails(string instanceType, IDictionary VmNics { get; } /// The discovered VM details. public InMageRcmDiscoveredProtectedVmDetails DiscoveredVmDetails { get; } + /// The target VM tags. + public IReadOnlyList TargetVmTags { get; } + /// The tags for the seed managed disks. + public IReadOnlyList SeedManagedDiskTags { get; } + /// The tags for the target managed disks. + public IReadOnlyList TargetManagedDiskTags { get; } + /// The tags for the target NICs. + public IReadOnlyList TargetNicTags { get; } + /// The SQL Server license type. + public string SqlServerLicenseType { get; } + /// A value indicating the inplace OS Upgrade version. + public IReadOnlyList SupportedOSVersions { get; } + /// The OS name associated with VM. + public string OSName { get; } + /// The target VM security profile. + public SecurityProfileProperties TargetVmSecurityProfile { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.Serialization.cs index 404744c6a764..23c4454f4967 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.Serialization.cs @@ -45,6 +45,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("recoveryPointId"u8); writer.WriteStringValue(RecoveryPointId); } + if (Optional.IsDefined(OSUpgradeVersion)) + { + writer.WritePropertyName("osUpgradeVersion"u8); + writer.WriteStringValue(OSUpgradeVersion); + } } InMageRcmTestFailoverContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -69,6 +74,7 @@ internal static InMageRcmTestFailoverContent DeserializeInMageRcmTestFailoverCon } ResourceIdentifier networkId = default; ResourceIdentifier recoveryPointId = default; + string osUpgradeVersion = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -92,6 +98,11 @@ internal static InMageRcmTestFailoverContent DeserializeInMageRcmTestFailoverCon recoveryPointId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("osUpgradeVersion"u8)) + { + osUpgradeVersion = property.Value.GetString(); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -103,7 +114,7 @@ internal static InMageRcmTestFailoverContent DeserializeInMageRcmTestFailoverCon } } serializedAdditionalRawData = rawDataDictionary; - return new InMageRcmTestFailoverContent(instanceType, serializedAdditionalRawData, networkId, recoveryPointId); + return new InMageRcmTestFailoverContent(instanceType, serializedAdditionalRawData, networkId, recoveryPointId, osUpgradeVersion); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.cs index e83c072da18a..4a411943b4b8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmTestFailoverContent.cs @@ -25,10 +25,12 @@ public InMageRcmTestFailoverContent() /// Keeps track of any properties unknown to the library. /// The test network Id. /// The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - internal InMageRcmTestFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier networkId, ResourceIdentifier recoveryPointId) : base(instanceType, serializedAdditionalRawData) + /// A value indicating the inplace OS Upgrade version. + internal InMageRcmTestFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier networkId, ResourceIdentifier recoveryPointId, string osUpgradeVersion) : base(instanceType, serializedAdditionalRawData) { NetworkId = networkId; RecoveryPointId = recoveryPointId; + OSUpgradeVersion = osUpgradeVersion; InstanceType = instanceType ?? "InMageRcm"; } @@ -36,5 +38,7 @@ internal InMageRcmTestFailoverContent(string instanceType, IDictionary The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. public ResourceIdentifier RecoveryPointId { get; set; } + /// A value indicating the inplace OS Upgrade version. + public string OSUpgradeVersion { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.Serialization.cs new file mode 100644 index 000000000000..bd6eaa2dadc8 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.Serialization.cs @@ -0,0 +1,155 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class InMageRcmUnProtectedDiskDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InMageRcmUnProtectedDiskDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DiskId)) + { + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + } + if (options.Format != "W" && Optional.IsDefined(DiskName)) + { + writer.WritePropertyName("diskName"u8); + writer.WriteStringValue(DiskName); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InMageRcmUnProtectedDiskDetails 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(InMageRcmUnProtectedDiskDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInMageRcmUnProtectedDiskDetails(document.RootElement, options); + } + + internal static InMageRcmUnProtectedDiskDetails DeserializeInMageRcmUnProtectedDiskDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + string diskName = default; + long? capacityInBytes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskName"u8)) + { + diskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InMageRcmUnProtectedDiskDetails(diskId, diskName, capacityInBytes, 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(InMageRcmUnProtectedDiskDetails)} does not support writing '{options.Format}' format."); + } + } + + InMageRcmUnProtectedDiskDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInMageRcmUnProtectedDiskDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InMageRcmUnProtectedDiskDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.cs new file mode 100644 index 000000000000..5e87fd9cd15e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnProtectedDiskDetails.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// InMageRcm un-protected disk details. + public partial class InMageRcmUnProtectedDiskDetails + { + /// + /// 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 InMageRcmUnProtectedDiskDetails() + { + } + + /// Initializes a new instance of . + /// The disk Id. + /// The disk name. + /// The disk capacity in bytes. + /// Keeps track of any properties unknown to the library. + internal InMageRcmUnProtectedDiskDetails(string diskId, string diskName, long? capacityInBytes, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + DiskName = diskName; + CapacityInBytes = capacityInBytes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk Id. + public string DiskId { get; } + /// The disk name. + public string DiskName { get; } + /// The disk capacity in bytes. + public long? CapacityInBytes { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.Serialization.cs index add13d219f62..b329ba8366ed 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.Serialization.cs @@ -42,6 +42,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("recoveryPointId"u8); writer.WriteStringValue(RecoveryPointId); } + if (Optional.IsDefined(OSUpgradeVersion)) + { + writer.WritePropertyName("osUpgradeVersion"u8); + writer.WriteStringValue(OSUpgradeVersion); + } } InMageRcmUnplannedFailoverContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,6 +71,7 @@ internal static InMageRcmUnplannedFailoverContent DeserializeInMageRcmUnplannedF } string performShutdown = default; ResourceIdentifier recoveryPointId = default; + string osUpgradeVersion = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -85,6 +91,11 @@ internal static InMageRcmUnplannedFailoverContent DeserializeInMageRcmUnplannedF recoveryPointId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("osUpgradeVersion"u8)) + { + osUpgradeVersion = property.Value.GetString(); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -96,7 +107,7 @@ internal static InMageRcmUnplannedFailoverContent DeserializeInMageRcmUnplannedF } } serializedAdditionalRawData = rawDataDictionary; - return new InMageRcmUnplannedFailoverContent(instanceType, serializedAdditionalRawData, performShutdown, recoveryPointId); + return new InMageRcmUnplannedFailoverContent(instanceType, serializedAdditionalRawData, performShutdown, recoveryPointId, osUpgradeVersion); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.cs index 2f5cf2725b44..866d74b03497 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUnplannedFailoverContent.cs @@ -30,10 +30,12 @@ public InMageRcmUnplannedFailoverContent(string performShutdown) /// Keeps track of any properties unknown to the library. /// A value indicating whether VM is to be shutdown. /// The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - internal InMageRcmUnplannedFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, string performShutdown, ResourceIdentifier recoveryPointId) : base(instanceType, serializedAdditionalRawData) + /// A value indicating the inplace OS Upgrade version. + internal InMageRcmUnplannedFailoverContent(string instanceType, IDictionary serializedAdditionalRawData, string performShutdown, ResourceIdentifier recoveryPointId, string osUpgradeVersion) : base(instanceType, serializedAdditionalRawData) { PerformShutdown = performShutdown; RecoveryPointId = recoveryPointId; + OSUpgradeVersion = osUpgradeVersion; InstanceType = instanceType ?? "InMageRcm"; } @@ -46,5 +48,7 @@ internal InMageRcmUnplannedFailoverContent() public string PerformShutdown { get; } /// The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. public ResourceIdentifier RecoveryPointId { get; set; } + /// A value indicating the inplace OS Upgrade version. + public string OSUpgradeVersion { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.Serialization.cs index d2971e284ff0..98eecc158749 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.Serialization.cs @@ -95,6 +95,51 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("licenseType"u8); writer.WriteStringValue(LicenseType.Value.ToString()); } + if (Optional.IsDefined(SqlServerLicenseType)) + { + writer.WritePropertyName("sqlServerLicenseType"u8); + writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); + } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } + if (Optional.IsCollectionDefined(TargetVmTags)) + { + writer.WritePropertyName("targetVmTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetVmTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetManagedDiskTags)) + { + writer.WritePropertyName("targetManagedDiskTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetManagedDiskTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TargetNicTags)) + { + writer.WritePropertyName("targetNicTags"u8); + writer.WriteStartArray(); + foreach (var item in TargetNicTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } } InMageRcmUpdateReplicationProtectedItemContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -128,6 +173,12 @@ internal static InMageRcmUpdateReplicationProtectedItemContent DeserializeInMage ResourceIdentifier testNetworkId = default; IList vmNics = default; SiteRecoveryLicenseType? licenseType = default; + SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; + string userSelectedOSName = default; + IList targetVmTags = default; + IList targetManagedDiskTags = default; + IList targetNicTags = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -225,6 +276,71 @@ internal static InMageRcmUpdateReplicationProtectedItemContent DeserializeInMage licenseType = new SiteRecoveryLicenseType(property.Value.GetString()); continue; } + if (property.NameEquals("sqlServerLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetVmTags = array; + continue; + } + if (property.NameEquals("targetManagedDiskTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetManagedDiskTags = array; + continue; + } + if (property.NameEquals("targetNicTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(UserCreatedResourceTag.DeserializeUserCreatedResourceTag(item, options)); + } + targetNicTags = array; + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -249,7 +365,13 @@ internal static InMageRcmUpdateReplicationProtectedItemContent DeserializeInMage targetNetworkId, testNetworkId, vmNics ?? new ChangeTrackingList(), - licenseType); + licenseType, + sqlServerLicenseType, + linuxLicenseType, + userSelectedOSName, + targetVmTags ?? new ChangeTrackingList(), + targetManagedDiskTags ?? new ChangeTrackingList(), + targetNicTags ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.cs index 4fe525403e24..ca2ee57fc479 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/InMageRcmUpdateReplicationProtectedItemContent.cs @@ -18,6 +18,9 @@ public partial class InMageRcmUpdateReplicationProtectedItemContent : UpdateRepl public InMageRcmUpdateReplicationProtectedItemContent() { VmNics = new ChangeTrackingList(); + TargetVmTags = new ChangeTrackingList(); + TargetManagedDiskTags = new ChangeTrackingList(); + TargetNicTags = new ChangeTrackingList(); InstanceType = "InMageRcm"; } @@ -35,7 +38,13 @@ public InMageRcmUpdateReplicationProtectedItemContent() /// The test network ARM Id. /// The list of NIC details. /// The license type. - internal InMageRcmUpdateReplicationProtectedItemContent(string instanceType, IDictionary serializedAdditionalRawData, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IList vmNics, SiteRecoveryLicenseType? licenseType) : base(instanceType, serializedAdditionalRawData) + /// The SQL Server license type. + /// The license type for Linux VM's. + /// The OS name selected by user. + /// The target VM tags. + /// The tags for the target managed disks. + /// The tags for the target NICs. + internal InMageRcmUpdateReplicationProtectedItemContent(string instanceType, IDictionary serializedAdditionalRawData, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IList vmNics, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, string userSelectedOSName, IList targetVmTags, IList targetManagedDiskTags, IList targetNicTags) : base(instanceType, serializedAdditionalRawData) { TargetVmName = targetVmName; TargetVmSize = targetVmSize; @@ -48,6 +57,12 @@ internal InMageRcmUpdateReplicationProtectedItemContent(string instanceType, IDi TestNetworkId = testNetworkId; VmNics = vmNics; LicenseType = licenseType; + SqlServerLicenseType = sqlServerLicenseType; + LinuxLicenseType = linuxLicenseType; + UserSelectedOSName = userSelectedOSName; + TargetVmTags = targetVmTags; + TargetManagedDiskTags = targetManagedDiskTags; + TargetNicTags = targetNicTags; InstanceType = instanceType ?? "InMageRcm"; } @@ -73,5 +88,17 @@ internal InMageRcmUpdateReplicationProtectedItemContent(string instanceType, IDi public IList VmNics { get; } /// The license type. public SiteRecoveryLicenseType? LicenseType { get; set; } + /// The SQL Server license type. + public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } + /// The target VM tags. + public IList TargetVmTags { get; } + /// The tags for the target managed disks. + public IList TargetManagedDiskTags { get; } + /// The tags for the target NICs. + public IList TargetNicTags { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/LinuxLicenseType.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/LinuxLicenseType.cs new file mode 100644 index 000000000000..e3113bd0c3f5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/LinuxLicenseType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// The license type for Linux VM's. + public readonly partial struct LinuxLicenseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LinuxLicenseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSpecifiedValue = "NotSpecified"; + private const string NoLicenseTypeValue = "NoLicenseType"; + private const string LinuxServerValue = "LinuxServer"; + + /// NotSpecified. + public static LinuxLicenseType NotSpecified { get; } = new LinuxLicenseType(NotSpecifiedValue); + /// NoLicenseType. + public static LinuxLicenseType NoLicenseType { get; } = new LinuxLicenseType(NoLicenseTypeValue); + /// LinuxServer. + public static LinuxLicenseType LinuxServer { get; } = new LinuxLicenseType(LinuxServerValue); + /// Determines if two values are the same. + public static bool operator ==(LinuxLicenseType left, LinuxLicenseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LinuxLicenseType left, LinuxLicenseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LinuxLicenseType(string value) => new LinuxLicenseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LinuxLicenseType other && Equals(other); + /// + public bool Equals(LinuxLicenseType 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.Serialization.cs new file mode 100644 index 000000000000..8cb85c468277 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.Serialization.cs @@ -0,0 +1,142 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ManagedRunCommandScriptContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedRunCommandScriptContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("stepName"u8); + writer.WriteStringValue(StepName); + writer.WritePropertyName("scriptUrl"u8); + writer.WriteStringValue(ScriptUri.AbsoluteUri); + writer.WritePropertyName("scriptParameters"u8); + writer.WriteStringValue(ScriptParameters); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedRunCommandScriptContent 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(ManagedRunCommandScriptContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedRunCommandScriptContent(document.RootElement, options); + } + + internal static ManagedRunCommandScriptContent DeserializeManagedRunCommandScriptContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string stepName = default; + Uri scriptUrl = default; + string scriptParameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("stepName"u8)) + { + stepName = property.Value.GetString(); + continue; + } + if (property.NameEquals("scriptUrl"u8)) + { + scriptUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("scriptParameters"u8)) + { + scriptParameters = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedRunCommandScriptContent(stepName, scriptUrl, scriptParameters, 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(ManagedRunCommandScriptContent)} does not support writing '{options.Format}' format."); + } + } + + ManagedRunCommandScriptContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedRunCommandScriptContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedRunCommandScriptContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.cs new file mode 100644 index 000000000000..2b1315e669c3 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ManagedRunCommandScriptContent.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Managed RunCommand script input. + public partial class ManagedRunCommandScriptContent + { + /// + /// 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 step name. + /// The script url. + /// The script parameters. + /// , or is null. + public ManagedRunCommandScriptContent(string stepName, Uri scriptUri, string scriptParameters) + { + Argument.AssertNotNull(stepName, nameof(stepName)); + Argument.AssertNotNull(scriptUri, nameof(scriptUri)); + Argument.AssertNotNull(scriptParameters, nameof(scriptParameters)); + + StepName = stepName; + ScriptUri = scriptUri; + ScriptParameters = scriptParameters; + } + + /// Initializes a new instance of . + /// The step name. + /// The script url. + /// The script parameters. + /// Keeps track of any properties unknown to the library. + internal ManagedRunCommandScriptContent(string stepName, Uri scriptUri, string scriptParameters, IDictionary serializedAdditionalRawData) + { + StepName = stepName; + ScriptUri = scriptUri; + ScriptParameters = scriptParameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ManagedRunCommandScriptContent() + { + } + + /// The step name. + public string StepName { get; } + /// The script url. + public Uri ScriptUri { get; } + /// The script parameters. + public string ScriptParameters { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.Serialization.cs new file mode 100644 index 000000000000..8411732c1ee5 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.Serialization.cs @@ -0,0 +1,166 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class RegisteredClusterNodes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegisteredClusterNodes)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClusterNodeFqdn)) + { + writer.WritePropertyName("clusterNodeFqdn"u8); + writer.WriteStringValue(ClusterNodeFqdn); + } + if (Optional.IsDefined(MachineId)) + { + writer.WritePropertyName("machineId"u8); + writer.WriteStringValue(MachineId); + } + if (Optional.IsDefined(BiosId)) + { + writer.WritePropertyName("biosId"u8); + writer.WriteStringValue(BiosId); + } + if (Optional.IsDefined(IsSharedDiskVirtualNode)) + { + writer.WritePropertyName("isSharedDiskVirtualNode"u8); + writer.WriteBooleanValue(IsSharedDiskVirtualNode.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RegisteredClusterNodes 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(RegisteredClusterNodes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegisteredClusterNodes(document.RootElement, options); + } + + internal static RegisteredClusterNodes DeserializeRegisteredClusterNodes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterNodeFqdn = default; + string machineId = default; + string biosId = default; + bool? isSharedDiskVirtualNode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterNodeFqdn"u8)) + { + clusterNodeFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineId"u8)) + { + machineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("biosId"u8)) + { + biosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isSharedDiskVirtualNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedDiskVirtualNode = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegisteredClusterNodes(clusterNodeFqdn, machineId, biosId, isSharedDiskVirtualNode, 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(RegisteredClusterNodes)} does not support writing '{options.Format}' format."); + } + } + + RegisteredClusterNodes 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRegisteredClusterNodes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegisteredClusterNodes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.cs new file mode 100644 index 000000000000..0144dc7cd085 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/RegisteredClusterNodes.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Extended location of the resource. + public partial class RegisteredClusterNodes + { + /// + /// 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 RegisteredClusterNodes() + { + } + + /// Initializes a new instance of . + /// The cluster node name. + /// The machine ID. + /// The BIOS ID. + /// A value indicating whether this represents virtual entity hosting all the shared disks. + /// Keeps track of any properties unknown to the library. + internal RegisteredClusterNodes(string clusterNodeFqdn, string machineId, string biosId, bool? isSharedDiskVirtualNode, IDictionary serializedAdditionalRawData) + { + ClusterNodeFqdn = clusterNodeFqdn; + MachineId = machineId; + BiosId = biosId; + IsSharedDiskVirtualNode = isSharedDiskVirtualNode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The cluster node name. + public string ClusterNodeFqdn { get; set; } + /// The machine ID. + public string MachineId { get; set; } + /// The BIOS ID. + public string BiosId { get; set; } + /// A value indicating whether this represents virtual entity hosting all the shared disks. + public bool? IsSharedDiskVirtualNode { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.Serialization.cs new file mode 100644 index 000000000000..53e9750e4454 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownReplicationClusterProviderSpecificSettings))] + public partial class ReplicationClusterProviderSpecificSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationClusterProviderSpecificSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationClusterProviderSpecificSettings 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(ReplicationClusterProviderSpecificSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationClusterProviderSpecificSettings(document.RootElement, options); + } + + internal static ReplicationClusterProviderSpecificSettings DeserializeReplicationClusterProviderSpecificSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2AReplicationProtectionClusterDetails.DeserializeA2AReplicationProtectionClusterDetails(element, options); + } + } + return UnknownReplicationClusterProviderSpecificSettings.DeserializeUnknownReplicationClusterProviderSpecificSettings(element, options); + } + + 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(ReplicationClusterProviderSpecificSettings)} does not support writing '{options.Format}' format."); + } + } + + ReplicationClusterProviderSpecificSettings 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationClusterProviderSpecificSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationClusterProviderSpecificSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.cs new file mode 100644 index 000000000000..d9bdd8711d58 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationClusterProviderSpecificSettings.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Replication cluster provider specific settings. + /// 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 . + /// + public abstract partial class ReplicationClusterProviderSpecificSettings + { + /// + /// 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 ReplicationClusterProviderSpecificSettings() + { + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal ReplicationClusterProviderSpecificSettings(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.Serialization.cs new file mode 100644 index 000000000000..a5f19cb25b3d --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.Serialization.cs @@ -0,0 +1,154 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class ReplicationProtectionClusterCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationProtectionClusterCollection)} does not support writing '{format}' format."); + } + + 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); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationProtectionClusterCollection 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(ReplicationProtectionClusterCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationProtectionClusterCollection(document.RootElement, options); + } + + internal static ReplicationProtectionClusterCollection DeserializeReplicationProtectionClusterCollection(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(ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(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 ReplicationProtectionClusterCollection(value ?? new ChangeTrackingList(), nextLink, 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(ReplicationProtectionClusterCollection)} does not support writing '{options.Format}' format."); + } + } + + ReplicationProtectionClusterCollection 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationProtectionClusterCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationProtectionClusterCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.cs new file mode 100644 index 000000000000..896391a201f4 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterCollection.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Replication protected item collection. + internal partial class ReplicationProtectionClusterCollection + { + /// + /// 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 ReplicationProtectionClusterCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The Replication protection cluster details. + /// The value of next link. + /// Keeps track of any properties unknown to the library. + internal ReplicationProtectionClusterCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Replication protection cluster details. + public IReadOnlyList Value { get; } + /// The value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.Serialization.cs new file mode 100644 index 000000000000..f82ee1e0dfd0 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.Serialization.cs @@ -0,0 +1,597 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class ReplicationProtectionClusterProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationProtectionClusterProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProtectionClusterType)) + { + writer.WritePropertyName("protectionClusterType"u8); + writer.WriteStringValue(ProtectionClusterType); + } + if (Optional.IsDefined(PrimaryFabricFriendlyName)) + { + writer.WritePropertyName("primaryFabricFriendlyName"u8); + writer.WriteStringValue(PrimaryFabricFriendlyName); + } + if (Optional.IsDefined(PrimaryFabricProvider)) + { + writer.WritePropertyName("primaryFabricProvider"u8); + writer.WriteStringValue(PrimaryFabricProvider); + } + if (Optional.IsDefined(RecoveryFabricFriendlyName)) + { + writer.WritePropertyName("recoveryFabricFriendlyName"u8); + writer.WriteStringValue(RecoveryFabricFriendlyName); + } + if (Optional.IsDefined(RecoveryFabricId)) + { + writer.WritePropertyName("recoveryFabricId"u8); + writer.WriteStringValue(RecoveryFabricId); + } + if (Optional.IsDefined(PrimaryProtectionContainerFriendlyName)) + { + writer.WritePropertyName("primaryProtectionContainerFriendlyName"u8); + writer.WriteStringValue(PrimaryProtectionContainerFriendlyName); + } + if (Optional.IsDefined(RecoveryProtectionContainerFriendlyName)) + { + writer.WritePropertyName("recoveryProtectionContainerFriendlyName"u8); + writer.WriteStringValue(RecoveryProtectionContainerFriendlyName); + } + if (Optional.IsDefined(ProtectionState)) + { + writer.WritePropertyName("protectionState"u8); + writer.WriteStringValue(ProtectionState); + } + if (Optional.IsDefined(ProtectionStateDescription)) + { + writer.WritePropertyName("protectionStateDescription"u8); + writer.WriteStringValue(ProtectionStateDescription); + } + if (Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation); + } + if (Optional.IsDefined(TestFailoverState)) + { + writer.WritePropertyName("testFailoverState"u8); + writer.WriteStringValue(TestFailoverState); + } + if (Optional.IsDefined(TestFailoverStateDescription)) + { + writer.WritePropertyName("testFailoverStateDescription"u8); + writer.WriteStringValue(TestFailoverStateDescription); + } + if (Optional.IsCollectionDefined(AllowedOperations)) + { + writer.WritePropertyName("allowedOperations"u8); + writer.WriteStartArray(); + foreach (var item in AllowedOperations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ReplicationHealth)) + { + writer.WritePropertyName("replicationHealth"u8); + writer.WriteStringValue(ReplicationHealth); + } + if (Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LastSuccessfulFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulFailoverOn.Value, "O"); + } + if (Optional.IsDefined(LastSuccessfulTestFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulTestFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulTestFailoverOn.Value, "O"); + } + if (Optional.IsDefined(PolicyFriendlyName)) + { + writer.WritePropertyName("policyFriendlyName"u8); + writer.WriteStringValue(PolicyFriendlyName); + } + if (Optional.IsDefined(CurrentScenario)) + { + writer.WritePropertyName("currentScenario"u8); + writer.WriteObjectValue(CurrentScenario, options); + } + if (Optional.IsDefined(RecoveryContainerId)) + { + writer.WritePropertyName("recoveryContainerId"u8); + writer.WriteStringValue(RecoveryContainerId); + } + if (Optional.IsDefined(AgentClusterId)) + { + writer.WritePropertyName("agentClusterId"u8); + writer.WriteStringValue(AgentClusterId); + } + if (Optional.IsDefined(ClusterFqdn)) + { + writer.WritePropertyName("clusterFqdn"u8); + writer.WriteStringValue(ClusterFqdn); + } + if (Optional.IsCollectionDefined(ClusterNodeFqdns)) + { + writer.WritePropertyName("clusterNodeFqdns"u8); + writer.WriteStartArray(); + foreach (var item in ClusterNodeFqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ClusterProtectedItemIds)) + { + writer.WritePropertyName("clusterProtectedItemIds"u8); + writer.WriteStartArray(); + foreach (var item in ClusterProtectedItemIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + if (Optional.IsDefined(AreAllClusterNodesRegistered)) + { + writer.WritePropertyName("areAllClusterNodesRegistered"u8); + writer.WriteBooleanValue(AreAllClusterNodesRegistered.Value); + } + if (Optional.IsCollectionDefined(ClusterRegisteredNodes)) + { + writer.WritePropertyName("clusterRegisteredNodes"u8); + writer.WriteStartArray(); + foreach (var item in ClusterRegisteredNodes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProviderSpecificDetails)) + { + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, options); + } + if (Optional.IsDefined(SharedDiskProperties)) + { + writer.WritePropertyName("sharedDiskProperties"u8); + writer.WriteObjectValue(SharedDiskProperties, options); + } + if (Optional.IsDefined(PolicyId)) + { + writer.WritePropertyName("policyId"u8); + writer.WriteStringValue(PolicyId); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationProtectionClusterProperties 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(ReplicationProtectionClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationProtectionClusterProperties(document.RootElement, options); + } + + internal static ReplicationProtectionClusterProperties DeserializeReplicationProtectionClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string protectionClusterType = default; + string primaryFabricFriendlyName = default; + string primaryFabricProvider = default; + string recoveryFabricFriendlyName = default; + ResourceIdentifier recoveryFabricId = default; + string primaryProtectionContainerFriendlyName = default; + string recoveryProtectionContainerFriendlyName = default; + string protectionState = default; + string protectionStateDescription = default; + string activeLocation = default; + string testFailoverState = default; + string testFailoverStateDescription = default; + IList allowedOperations = default; + string replicationHealth = default; + IList healthErrors = default; + DateTimeOffset? lastSuccessfulFailoverTime = default; + DateTimeOffset? lastSuccessfulTestFailoverTime = default; + string policyFriendlyName = default; + CurrentScenarioDetails currentScenario = default; + ResourceIdentifier recoveryContainerId = default; + string agentClusterId = default; + string clusterFqdn = default; + IList clusterNodeFqdns = default; + IList clusterProtectedItemIds = default; + string provisioningState = default; + bool? areAllClusterNodesRegistered = default; + IList clusterRegisteredNodes = default; + ReplicationClusterProviderSpecificSettings providerSpecificDetails = default; + SharedDiskReplicationItemProperties sharedDiskProperties = default; + ResourceIdentifier policyId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectionClusterType"u8)) + { + protectionClusterType = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryFabricFriendlyName"u8)) + { + primaryFabricFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("primaryFabricProvider"u8)) + { + primaryFabricProvider = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryFabricFriendlyName"u8)) + { + recoveryFabricFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryFabricId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryFabricId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("primaryProtectionContainerFriendlyName"u8)) + { + primaryProtectionContainerFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryProtectionContainerFriendlyName"u8)) + { + recoveryProtectionContainerFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectionState"u8)) + { + protectionState = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectionStateDescription"u8)) + { + protectionStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("activeLocation"u8)) + { + activeLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverState"u8)) + { + testFailoverState = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverStateDescription"u8)) + { + testFailoverStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedOperations = array; + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + replicationHealth = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteRecoveryHealthError.DeserializeSiteRecoveryHealthError(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("lastSuccessfulFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulTestFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulTestFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("policyFriendlyName"u8)) + { + policyFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("currentScenario"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentScenario = CurrentScenarioDetails.DeserializeCurrentScenarioDetails(property.Value, options); + continue; + } + if (property.NameEquals("recoveryContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("agentClusterId"u8)) + { + agentClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterFqdn"u8)) + { + clusterFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterNodeFqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + clusterNodeFqdns = array; + continue; + } + if (property.NameEquals("clusterProtectedItemIds"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())); + } + } + clusterProtectedItemIds = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (property.NameEquals("areAllClusterNodesRegistered"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + areAllClusterNodesRegistered = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("clusterRegisteredNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RegisteredClusterNodes.DeserializeRegisteredClusterNodes(item, options)); + } + clusterRegisteredNodes = array; + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerSpecificDetails = ReplicationClusterProviderSpecificSettings.DeserializeReplicationClusterProviderSpecificSettings(property.Value, options); + continue; + } + if (property.NameEquals("sharedDiskProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedDiskProperties = SharedDiskReplicationItemProperties.DeserializeSharedDiskReplicationItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("policyId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + policyId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicationProtectionClusterProperties( + protectionClusterType, + primaryFabricFriendlyName, + primaryFabricProvider, + recoveryFabricFriendlyName, + recoveryFabricId, + primaryProtectionContainerFriendlyName, + recoveryProtectionContainerFriendlyName, + protectionState, + protectionStateDescription, + activeLocation, + testFailoverState, + testFailoverStateDescription, + allowedOperations ?? new ChangeTrackingList(), + replicationHealth, + healthErrors ?? new ChangeTrackingList(), + lastSuccessfulFailoverTime, + lastSuccessfulTestFailoverTime, + policyFriendlyName, + currentScenario, + recoveryContainerId, + agentClusterId, + clusterFqdn, + clusterNodeFqdns ?? new ChangeTrackingList(), + clusterProtectedItemIds ?? new ChangeTrackingList(), + provisioningState, + areAllClusterNodesRegistered, + clusterRegisteredNodes ?? new ChangeTrackingList(), + providerSpecificDetails, + sharedDiskProperties, + policyId, + 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(ReplicationProtectionClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + ReplicationProtectionClusterProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationProtectionClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationProtectionClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.cs new file mode 100644 index 000000000000..6bf1fc47fe80 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/ReplicationProtectionClusterProperties.cs @@ -0,0 +1,195 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + /// Replication protection cluster custom data details. + public partial class ReplicationProtectionClusterProperties + { + /// + /// 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 ReplicationProtectionClusterProperties() + { + AllowedOperations = new ChangeTrackingList(); + HealthErrors = new ChangeTrackingList(); + ClusterNodeFqdns = new ChangeTrackingList(); + ClusterProtectedItemIds = new ChangeTrackingList(); + ClusterRegisteredNodes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The type of protection cluster type. + /// The friendly name of the primary fabric. + /// The fabric provider of the primary fabric. + /// The friendly name of recovery fabric. + /// The Arm Id of recovery fabric. + /// The name of primary protection container friendly name. + /// The name of recovery container friendly name. + /// The protection status. + /// The protection state description. + /// The Current active location of the Protection cluster. + /// The Test failover state. + /// The Test failover state description. + /// The allowed operations on the Replication protection cluster. + /// The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. + /// List of health errors. + /// The last successful failover time. + /// The last successful test failover time. + /// The name of Policy governing this PE. + /// The current scenario. + /// The recovery container Id. + /// The Agent cluster Id. + /// The cluster FQDN. + /// The List of cluster Node FQDNs. + /// The List of Protected Item Id's. + /// The provisioning state of the cluster. + /// A value indicating whether all nodes of the cluster are registered or not. + /// The registered node details. + /// + /// The Replication cluster provider custom settings. + /// 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 . + /// + /// The shared disk properties. + /// The Policy Id. + /// Keeps track of any properties unknown to the library. + internal ReplicationProtectionClusterProperties(string protectionClusterType, string primaryFabricFriendlyName, string primaryFabricProvider, string recoveryFabricFriendlyName, ResourceIdentifier recoveryFabricId, string primaryProtectionContainerFriendlyName, string recoveryProtectionContainerFriendlyName, string protectionState, string protectionStateDescription, string activeLocation, string testFailoverState, string testFailoverStateDescription, IList allowedOperations, string replicationHealth, IList healthErrors, DateTimeOffset? lastSuccessfulFailoverOn, DateTimeOffset? lastSuccessfulTestFailoverOn, string policyFriendlyName, CurrentScenarioDetails currentScenario, ResourceIdentifier recoveryContainerId, string agentClusterId, string clusterFqdn, IList clusterNodeFqdns, IList clusterProtectedItemIds, string provisioningState, bool? areAllClusterNodesRegistered, IList clusterRegisteredNodes, ReplicationClusterProviderSpecificSettings providerSpecificDetails, SharedDiskReplicationItemProperties sharedDiskProperties, ResourceIdentifier policyId, IDictionary serializedAdditionalRawData) + { + ProtectionClusterType = protectionClusterType; + PrimaryFabricFriendlyName = primaryFabricFriendlyName; + PrimaryFabricProvider = primaryFabricProvider; + RecoveryFabricFriendlyName = recoveryFabricFriendlyName; + RecoveryFabricId = recoveryFabricId; + PrimaryProtectionContainerFriendlyName = primaryProtectionContainerFriendlyName; + RecoveryProtectionContainerFriendlyName = recoveryProtectionContainerFriendlyName; + ProtectionState = protectionState; + ProtectionStateDescription = protectionStateDescription; + ActiveLocation = activeLocation; + TestFailoverState = testFailoverState; + TestFailoverStateDescription = testFailoverStateDescription; + AllowedOperations = allowedOperations; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + LastSuccessfulFailoverOn = lastSuccessfulFailoverOn; + LastSuccessfulTestFailoverOn = lastSuccessfulTestFailoverOn; + PolicyFriendlyName = policyFriendlyName; + CurrentScenario = currentScenario; + RecoveryContainerId = recoveryContainerId; + AgentClusterId = agentClusterId; + ClusterFqdn = clusterFqdn; + ClusterNodeFqdns = clusterNodeFqdns; + ClusterProtectedItemIds = clusterProtectedItemIds; + ProvisioningState = provisioningState; + AreAllClusterNodesRegistered = areAllClusterNodesRegistered; + ClusterRegisteredNodes = clusterRegisteredNodes; + ProviderSpecificDetails = providerSpecificDetails; + SharedDiskProperties = sharedDiskProperties; + PolicyId = policyId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of protection cluster type. + public string ProtectionClusterType { get; set; } + /// The friendly name of the primary fabric. + public string PrimaryFabricFriendlyName { get; set; } + /// The fabric provider of the primary fabric. + public string PrimaryFabricProvider { get; set; } + /// The friendly name of recovery fabric. + public string RecoveryFabricFriendlyName { get; set; } + /// The Arm Id of recovery fabric. + public ResourceIdentifier RecoveryFabricId { get; set; } + /// The name of primary protection container friendly name. + public string PrimaryProtectionContainerFriendlyName { get; set; } + /// The name of recovery container friendly name. + public string RecoveryProtectionContainerFriendlyName { get; set; } + /// The protection status. + public string ProtectionState { get; set; } + /// The protection state description. + public string ProtectionStateDescription { get; set; } + /// The Current active location of the Protection cluster. + public string ActiveLocation { get; set; } + /// The Test failover state. + public string TestFailoverState { get; set; } + /// The Test failover state description. + public string TestFailoverStateDescription { get; set; } + /// The allowed operations on the Replication protection cluster. + public IList AllowedOperations { get; } + /// The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. + public string ReplicationHealth { get; set; } + /// List of health errors. + public IList HealthErrors { get; } + /// The last successful failover time. + public DateTimeOffset? LastSuccessfulFailoverOn { get; set; } + /// The last successful test failover time. + public DateTimeOffset? LastSuccessfulTestFailoverOn { get; set; } + /// The name of Policy governing this PE. + public string PolicyFriendlyName { get; set; } + /// The current scenario. + public CurrentScenarioDetails CurrentScenario { get; set; } + /// The recovery container Id. + public ResourceIdentifier RecoveryContainerId { get; set; } + /// The Agent cluster Id. + public string AgentClusterId { get; set; } + /// The cluster FQDN. + public string ClusterFqdn { get; set; } + /// The List of cluster Node FQDNs. + public IList ClusterNodeFqdns { get; } + /// The List of Protected Item Id's. + public IList ClusterProtectedItemIds { get; } + /// The provisioning state of the cluster. + public string ProvisioningState { get; } + /// A value indicating whether all nodes of the cluster are registered or not. + public bool? AreAllClusterNodesRegistered { get; set; } + /// The registered node details. + public IList ClusterRegisteredNodes { get; } + /// + /// The Replication cluster provider custom settings. + /// 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 . + /// + public ReplicationClusterProviderSpecificSettings ProviderSpecificDetails { get; set; } + /// The shared disk properties. + public SharedDiskReplicationItemProperties SharedDiskProperties { get; set; } + /// The Policy Id. + public ResourceIdentifier PolicyId { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityConfiguration.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityConfiguration.cs new file mode 100644 index 000000000000..df1a984a9710 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityConfiguration.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Security configuration state. + public readonly partial struct SecurityConfiguration : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SecurityConfiguration(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisabledValue = "Disabled"; + private const string EnabledValue = "Enabled"; + + /// Disabled. + public static SecurityConfiguration Disabled { get; } = new SecurityConfiguration(DisabledValue); + /// Enabled. + public static SecurityConfiguration Enabled { get; } = new SecurityConfiguration(EnabledValue); + /// Determines if two values are the same. + public static bool operator ==(SecurityConfiguration left, SecurityConfiguration right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SecurityConfiguration left, SecurityConfiguration right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SecurityConfiguration(string value) => new SecurityConfiguration(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SecurityConfiguration other && Equals(other); + /// + public bool Equals(SecurityConfiguration 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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.Serialization.cs new file mode 100644 index 000000000000..f7bc777d0f39 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.Serialization.cs @@ -0,0 +1,199 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class SecurityProfileProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityProfileProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetVmSecurityType)) + { + writer.WritePropertyName("targetVmSecurityType"u8); + writer.WriteStringValue(TargetVmSecurityType.Value.ToString()); + } + if (Optional.IsDefined(TargetVmSecureBoot)) + { + writer.WritePropertyName("targetVmSecureBoot"u8); + writer.WriteStringValue(TargetVmSecureBoot.Value.ToString()); + } + if (Optional.IsDefined(TargetVmTpm)) + { + writer.WritePropertyName("targetVmTpm"u8); + writer.WriteStringValue(TargetVmTpm.Value.ToString()); + } + if (Optional.IsDefined(TargetVmMonitoring)) + { + writer.WritePropertyName("targetVmMonitoring"u8); + writer.WriteStringValue(TargetVmMonitoring.Value.ToString()); + } + if (Optional.IsDefined(TargetVmConfidentialEncryption)) + { + writer.WritePropertyName("targetVmConfidentialEncryption"u8); + writer.WriteStringValue(TargetVmConfidentialEncryption.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityProfileProperties 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(SecurityProfileProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityProfileProperties(document.RootElement, options); + } + + internal static SecurityProfileProperties DeserializeSecurityProfileProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SiteRecoveryVmSecurityType? targetVmSecurityType = default; + SecurityConfiguration? targetVmSecureBoot = default; + SecurityConfiguration? targetVmTpm = default; + SecurityConfiguration? targetVmMonitoring = default; + SecurityConfiguration? targetVmConfidentialEncryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetVmSecurityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecurityType = new SiteRecoveryVmSecurityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmSecureBoot"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmSecureBoot = new SecurityConfiguration(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmTpm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmTpm = new SecurityConfiguration(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmMonitoring"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmMonitoring = new SecurityConfiguration(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetVmConfidentialEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetVmConfidentialEncryption = new SecurityConfiguration(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityProfileProperties( + targetVmSecurityType, + targetVmSecureBoot, + targetVmTpm, + targetVmMonitoring, + targetVmConfidentialEncryption, + 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(SecurityProfileProperties)} does not support writing '{options.Format}' format."); + } + } + + SecurityProfileProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSecurityProfileProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityProfileProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.cs new file mode 100644 index 000000000000..470d53a3602a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SecurityProfileProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Security profile input. + public partial class SecurityProfileProperties + { + /// + /// 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 SecurityProfileProperties() + { + } + + /// Initializes a new instance of . + /// The target VM security type. + /// A value indicating whether secure boot to be enabled. + /// A value indicating whether trusted platform module to be enabled. + /// A value indicating whether integrity monitoring to be enabled. + /// A value indicating whether confidential compute encryption to be enabled. + /// Keeps track of any properties unknown to the library. + internal SecurityProfileProperties(SiteRecoveryVmSecurityType? targetVmSecurityType, SecurityConfiguration? targetVmSecureBoot, SecurityConfiguration? targetVmTpm, SecurityConfiguration? targetVmMonitoring, SecurityConfiguration? targetVmConfidentialEncryption, IDictionary serializedAdditionalRawData) + { + TargetVmSecurityType = targetVmSecurityType; + TargetVmSecureBoot = targetVmSecureBoot; + TargetVmTpm = targetVmTpm; + TargetVmMonitoring = targetVmMonitoring; + TargetVmConfidentialEncryption = targetVmConfidentialEncryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The target VM security type. + public SiteRecoveryVmSecurityType? TargetVmSecurityType { get; set; } + /// A value indicating whether secure boot to be enabled. + public SecurityConfiguration? TargetVmSecureBoot { get; set; } + /// A value indicating whether trusted platform module to be enabled. + public SecurityConfiguration? TargetVmTpm { get; set; } + /// A value indicating whether integrity monitoring to be enabled. + public SecurityConfiguration? TargetVmMonitoring { get; set; } + /// A value indicating whether confidential compute encryption to be enabled. + public SecurityConfiguration? TargetVmConfidentialEncryption { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.Serialization.cs new file mode 100644 index 000000000000..4f890df8adb3 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.Serialization.cs @@ -0,0 +1,251 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class SharedDiskReplicationItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedDiskReplicationItemProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProtectionState)) + { + writer.WritePropertyName("protectionState"u8); + writer.WriteStringValue(ProtectionState); + } + if (Optional.IsDefined(TestFailoverState)) + { + writer.WritePropertyName("testFailoverState"u8); + writer.WriteStringValue(TestFailoverState); + } + if (Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation); + } + if (Optional.IsCollectionDefined(AllowedOperations)) + { + writer.WritePropertyName("allowedOperations"u8); + writer.WriteStartArray(); + foreach (var item in AllowedOperations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ReplicationHealth)) + { + writer.WritePropertyName("replicationHealth"u8); + writer.WriteStringValue(ReplicationHealth); + } + if (Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(CurrentScenario)) + { + writer.WritePropertyName("currentScenario"u8); + writer.WriteObjectValue(CurrentScenario, options); + } + if (Optional.IsDefined(SharedDiskProviderSpecificDetails)) + { + writer.WritePropertyName("sharedDiskProviderSpecificDetails"u8); + writer.WriteObjectValue(SharedDiskProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedDiskReplicationItemProperties 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(SharedDiskReplicationItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedDiskReplicationItemProperties(document.RootElement, options); + } + + internal static SharedDiskReplicationItemProperties DeserializeSharedDiskReplicationItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string protectionState = default; + string testFailoverState = default; + string activeLocation = default; + IList allowedOperations = default; + string replicationHealth = default; + IList healthErrors = default; + CurrentScenarioDetails currentScenario = default; + SharedDiskReplicationProviderSpecificSettings sharedDiskProviderSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectionState"u8)) + { + protectionState = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverState"u8)) + { + testFailoverState = property.Value.GetString(); + continue; + } + if (property.NameEquals("activeLocation"u8)) + { + activeLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedOperations = array; + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + replicationHealth = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SiteRecoveryHealthError.DeserializeSiteRecoveryHealthError(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("currentScenario"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentScenario = CurrentScenarioDetails.DeserializeCurrentScenarioDetails(property.Value, options); + continue; + } + if (property.NameEquals("sharedDiskProviderSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedDiskProviderSpecificDetails = SharedDiskReplicationProviderSpecificSettings.DeserializeSharedDiskReplicationProviderSpecificSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedDiskReplicationItemProperties( + protectionState, + testFailoverState, + activeLocation, + allowedOperations ?? new ChangeTrackingList(), + replicationHealth, + healthErrors ?? new ChangeTrackingList(), + currentScenario, + sharedDiskProviderSpecificDetails, + 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(SharedDiskReplicationItemProperties)} does not support writing '{options.Format}' format."); + } + } + + SharedDiskReplicationItemProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSharedDiskReplicationItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedDiskReplicationItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.cs new file mode 100644 index 000000000000..9d64619c3eac --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationItemProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Shared Disk Replication item custom data details. + public partial class SharedDiskReplicationItemProperties + { + /// + /// 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 SharedDiskReplicationItemProperties() + { + AllowedOperations = new ChangeTrackingList(); + HealthErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The protection state of shared disk. + /// The tfo state of shared disk. + /// The Current active location of the PE. + /// The allowed operations on the Replication protected item. + /// The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. + /// List of health errors. + /// The current scenario. + /// + /// The Replication provider custom settings. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal SharedDiskReplicationItemProperties(string protectionState, string testFailoverState, string activeLocation, IList allowedOperations, string replicationHealth, IList healthErrors, CurrentScenarioDetails currentScenario, SharedDiskReplicationProviderSpecificSettings sharedDiskProviderSpecificDetails, IDictionary serializedAdditionalRawData) + { + ProtectionState = protectionState; + TestFailoverState = testFailoverState; + ActiveLocation = activeLocation; + AllowedOperations = allowedOperations; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + CurrentScenario = currentScenario; + SharedDiskProviderSpecificDetails = sharedDiskProviderSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The protection state of shared disk. + public string ProtectionState { get; set; } + /// The tfo state of shared disk. + public string TestFailoverState { get; set; } + /// The Current active location of the PE. + public string ActiveLocation { get; set; } + /// The allowed operations on the Replication protected item. + public IList AllowedOperations { get; } + /// The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. + public string ReplicationHealth { get; set; } + /// List of health errors. + public IList HealthErrors { get; } + /// The current scenario. + public CurrentScenarioDetails CurrentScenario { get; set; } + /// + /// The Replication provider custom settings. + /// 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 . + /// + public SharedDiskReplicationProviderSpecificSettings SharedDiskProviderSpecificDetails { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.Serialization.cs new file mode 100644 index 000000000000..33761fb5af85 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownSharedDiskReplicationProviderSpecificSettings))] + public partial class SharedDiskReplicationProviderSpecificSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedDiskReplicationProviderSpecificSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SharedDiskReplicationProviderSpecificSettings 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(SharedDiskReplicationProviderSpecificSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedDiskReplicationProviderSpecificSettings(document.RootElement, options); + } + + internal static SharedDiskReplicationProviderSpecificSettings DeserializeSharedDiskReplicationProviderSpecificSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2ASharedDiskReplicationDetails.DeserializeA2ASharedDiskReplicationDetails(element, options); + } + } + return UnknownSharedDiskReplicationProviderSpecificSettings.DeserializeUnknownSharedDiskReplicationProviderSpecificSettings(element, options); + } + + 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(SharedDiskReplicationProviderSpecificSettings)} does not support writing '{options.Format}' format."); + } + } + + SharedDiskReplicationProviderSpecificSettings 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSharedDiskReplicationProviderSpecificSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedDiskReplicationProviderSpecificSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.cs new file mode 100644 index 000000000000..35b004a451d7 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SharedDiskReplicationProviderSpecificSettings.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Replication provider specific settings. + /// 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 . + /// + public abstract partial class SharedDiskReplicationProviderSpecificSettings + { + /// + /// 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 SharedDiskReplicationProviderSpecificSettings() + { + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal SharedDiskReplicationProviderSpecificSettings(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksContent.cs index b02b5826cc4e..2b226eeb4c7b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksContent.cs @@ -64,7 +64,7 @@ internal SiteRecoveryAddDisksContent(SiteRecoveryAddDisksProperties properties, /// /// The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. /// 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 . + /// The available derived classes include and . /// public SiteRecoveryAddDisksProviderSpecificContent SiteRecoveryAddDisksProviderSpecificDetails { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProperties.cs index ecdb0719e0f5..1cdb474bccf6 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProperties.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProperties.cs @@ -49,7 +49,7 @@ internal partial class SiteRecoveryAddDisksProperties /// /// The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. /// 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 . + /// The available derived classes include and . /// /// is null. public SiteRecoveryAddDisksProperties(SiteRecoveryAddDisksProviderSpecificContent providerSpecificDetails) @@ -63,7 +63,7 @@ public SiteRecoveryAddDisksProperties(SiteRecoveryAddDisksProviderSpecificConten /// /// The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. /// 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 . + /// The available derived classes include and . /// /// Keeps track of any properties unknown to the library. internal SiteRecoveryAddDisksProperties(SiteRecoveryAddDisksProviderSpecificContent providerSpecificDetails, IDictionary serializedAdditionalRawData) @@ -80,7 +80,7 @@ internal SiteRecoveryAddDisksProperties() /// /// The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. /// 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 . + /// The available derived classes include and . /// public SiteRecoveryAddDisksProviderSpecificContent ProviderSpecificDetails { get; } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.Serialization.cs index 324c55ea6169..660f9b9ebd9d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.Serialization.cs @@ -78,6 +78,7 @@ internal static SiteRecoveryAddDisksProviderSpecificContent DeserializeSiteRecov switch (discriminator.GetString()) { case "A2A": return A2AAddDisksContent.DeserializeA2AAddDisksContent(element, options); + case "InMageRcm": return InMageRcmAddDisksContent.DeserializeInMageRcmAddDisksContent(element, options); } } return UnknownAddDisksProviderSpecificContent.DeserializeUnknownAddDisksProviderSpecificContent(element, options); diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.cs index 9f49f18efe44..b854dd728d0d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryAddDisksProviderSpecificContent.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models /// /// Add Disks provider specific input. /// 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 . + /// The available derived classes include and . /// public abstract partial class SiteRecoveryAddDisksProviderSpecificContent { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryDiskAccountType.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryDiskAccountType.cs index 9921b0310b5e..e855cb69beac 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryDiskAccountType.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryDiskAccountType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models { - /// The DiskType. + /// The disk type. public readonly partial struct SiteRecoveryDiskAccountType : IEquatable { private readonly string _value; @@ -25,6 +25,10 @@ public SiteRecoveryDiskAccountType(string value) private const string StandardLrsValue = "Standard_LRS"; private const string PremiumLrsValue = "Premium_LRS"; private const string StandardSsdLrsValue = "StandardSSD_LRS"; + private const string PremiumV2LrsValue = "PremiumV2_LRS"; + private const string UltraSsdLrsValue = "UltraSSD_LRS"; + private const string StandardSsdZRSValue = "StandardSSD_ZRS"; + private const string PremiumZRSValue = "Premium_ZRS"; /// Standard_LRS. public static SiteRecoveryDiskAccountType StandardLrs { get; } = new SiteRecoveryDiskAccountType(StandardLrsValue); @@ -32,6 +36,14 @@ public SiteRecoveryDiskAccountType(string value) public static SiteRecoveryDiskAccountType PremiumLrs { get; } = new SiteRecoveryDiskAccountType(PremiumLrsValue); /// StandardSSD_LRS. public static SiteRecoveryDiskAccountType StandardSsdLrs { get; } = new SiteRecoveryDiskAccountType(StandardSsdLrsValue); + /// PremiumV2_LRS. + public static SiteRecoveryDiskAccountType PremiumV2Lrs { get; } = new SiteRecoveryDiskAccountType(PremiumV2LrsValue); + /// UltraSSD_LRS. + public static SiteRecoveryDiskAccountType UltraSsdLrs { get; } = new SiteRecoveryDiskAccountType(UltraSsdLrsValue); + /// StandardSSD_ZRS. + public static SiteRecoveryDiskAccountType StandardSsdZRS { get; } = new SiteRecoveryDiskAccountType(StandardSsdZRSValue); + /// Premium_ZRS. + public static SiteRecoveryDiskAccountType PremiumZRS { get; } = new SiteRecoveryDiskAccountType(PremiumZRSValue); /// Determines if two values are the same. public static bool operator ==(SiteRecoveryDiskAccountType left, SiteRecoveryDiskAccountType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.Serialization.cs index 242aac20bab2..1922909c6599 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.Serialization.cs @@ -151,7 +151,7 @@ internal static SiteRecoveryHealthError DeserializeSiteRecoveryHealthError(JsonE { return null; } - IReadOnlyList innerHealthErrors = default; + IList innerHealthErrors = default; string errorSource = default; string errorType = default; string errorLevel = default; diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.cs index bb963fbe7b04..09dd2904c50e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryHealthError.cs @@ -46,7 +46,7 @@ public partial class SiteRecoveryHealthError private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SiteRecoveryHealthError() + public SiteRecoveryHealthError() { InnerHealthErrors = new ChangeTrackingList(); } @@ -68,7 +68,7 @@ internal SiteRecoveryHealthError() /// The health error unique id. /// Value indicating whether the health error is customer resolvable. /// Keeps track of any properties unknown to the library. - internal SiteRecoveryHealthError(IReadOnlyList innerHealthErrors, string errorSource, string errorType, string errorLevel, string errorCategory, string errorCode, string summaryMessage, string errorMessage, string possibleCauses, string recommendedAction, DateTimeOffset? creationTimeUtc, string recoveryProviderErrorMessage, string entityId, string errorId, HealthErrorCustomerResolvability? customerResolvability, IDictionary serializedAdditionalRawData) + internal SiteRecoveryHealthError(IList innerHealthErrors, string errorSource, string errorType, string errorLevel, string errorCategory, string errorCode, string summaryMessage, string errorMessage, string possibleCauses, string recommendedAction, DateTimeOffset? creationTimeUtc, string recoveryProviderErrorMessage, string entityId, string errorId, HealthErrorCustomerResolvability? customerResolvability, IDictionary serializedAdditionalRawData) { InnerHealthErrors = innerHealthErrors; ErrorSource = errorSource; @@ -89,34 +89,34 @@ internal SiteRecoveryHealthError(IReadOnlyList inn } /// The inner health errors. HealthError having a list of HealthError as child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. - public IReadOnlyList InnerHealthErrors { get; } + public IList InnerHealthErrors { get; } /// Source of error. - public string ErrorSource { get; } + public string ErrorSource { get; set; } /// Type of error. - public string ErrorType { get; } + public string ErrorType { get; set; } /// Level of error. - public string ErrorLevel { get; } + public string ErrorLevel { get; set; } /// Category of error. - public string ErrorCategory { get; } + public string ErrorCategory { get; set; } /// Error code. - public string ErrorCode { get; } + public string ErrorCode { get; set; } /// Summary message of the entity. - public string SummaryMessage { get; } + public string SummaryMessage { get; set; } /// Error message. - public string ErrorMessage { get; } + public string ErrorMessage { get; set; } /// Possible causes of error. - public string PossibleCauses { get; } + public string PossibleCauses { get; set; } /// Recommended action to resolve error. - public string RecommendedAction { get; } + public string RecommendedAction { get; set; } /// Error creation time (UTC). - public DateTimeOffset? CreationTimeUtc { get; } + public DateTimeOffset? CreationTimeUtc { get; set; } /// DRA error message. - public string RecoveryProviderErrorMessage { get; } + public string RecoveryProviderErrorMessage { get; set; } /// ID of the entity. - public string EntityId { get; } + public string EntityId { get; set; } /// The health error unique id. - public string ErrorId { get; } + public string ErrorId { get; set; } /// Value indicating whether the health error is customer resolvable. - public HealthErrorCustomerResolvability? CustomerResolvability { get; } + public HealthErrorCustomerResolvability? CustomerResolvability { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryInnerHealthError.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryInnerHealthError.cs index f0feb7247a67..95bf7836d9d1 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryInnerHealthError.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryInnerHealthError.cs @@ -46,7 +46,7 @@ public partial class SiteRecoveryInnerHealthError private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SiteRecoveryInnerHealthError() + public SiteRecoveryInnerHealthError() { } @@ -86,32 +86,32 @@ internal SiteRecoveryInnerHealthError(string errorSource, string errorType, stri } /// Source of error. - public string ErrorSource { get; } + public string ErrorSource { get; set; } /// Type of error. - public string ErrorType { get; } + public string ErrorType { get; set; } /// Level of error. - public string ErrorLevel { get; } + public string ErrorLevel { get; set; } /// Category of error. - public string ErrorCategory { get; } + public string ErrorCategory { get; set; } /// Error code. - public string ErrorCode { get; } + public string ErrorCode { get; set; } /// Summary message of the entity. - public string SummaryMessage { get; } + public string SummaryMessage { get; set; } /// Error message. - public string ErrorMessage { get; } + public string ErrorMessage { get; set; } /// Possible causes of error. - public string PossibleCauses { get; } + public string PossibleCauses { get; set; } /// Recommended action to resolve error. - public string RecommendedAction { get; } + public string RecommendedAction { get; set; } /// Error creation time (UTC). - public DateTimeOffset? CreatedOn { get; } + public DateTimeOffset? CreatedOn { get; set; } /// DRA error message. - public string RecoveryProviderErrorMessage { get; } + public string RecoveryProviderErrorMessage { get; set; } /// ID of the entity. - public string EntityId { get; } + public string EntityId { get; set; } /// The health error unique id. - public string ErrorId { get; } + public string ErrorId { get; set; } /// Value indicating whether the health error is customer resolvable. - public HealthErrorCustomerResolvability? CustomerResolvability { get; } + public HealthErrorCustomerResolvability? CustomerResolvability { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.Serialization.cs index 9ab11b3205ae..59ef603954e8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.Serialization.cs @@ -89,6 +89,9 @@ internal static SiteRecoveryJobDetails DeserializeSiteRecoveryJobDetails(JsonEle switch (discriminator.GetString()) { case "AsrJobDetails": return AsrJobDetails.DeserializeAsrJobDetails(element, options); + case "ClusterFailoverJobDetails": return ClusterFailoverJobDetails.DeserializeClusterFailoverJobDetails(element, options); + case "ClusterSwitchProtectionJobDetails": return ClusterSwitchProtectionJobDetails.DeserializeClusterSwitchProtectionJobDetails(element, options); + case "ClusterTestFailoverJobDetails": return ClusterTestFailoverJobDetails.DeserializeClusterTestFailoverJobDetails(element, options); case "ExportJobDetails": return ExportJobDetails.DeserializeExportJobDetails(element, options); case "FailoverJobDetails": return FailoverJobDetails.DeserializeFailoverJobDetails(element, options); case "SwitchProtectionJobDetails": return SwitchProtectionJobDetails.DeserializeSwitchProtectionJobDetails(element, options); diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.cs index aacc3a026082..a691ea32712a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobDetails.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models /// /// Job details based on specific job type. /// 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 . + /// The available derived classes include , , , , , , and . /// public abstract partial class SiteRecoveryJobDetails { diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobProperties.cs index ad1b15b32946..cbf92101af85 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobProperties.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryJobProperties.cs @@ -70,7 +70,7 @@ internal SiteRecoveryJobProperties() /// /// The custom job details like test failover job 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 . + /// The available derived classes include , , , , , , and . /// /// Keeps track of any properties unknown to the library. internal SiteRecoveryJobProperties(string activityId, string scenarioName, string friendlyName, string state, string stateDescription, IReadOnlyList tasks, IReadOnlyList errors, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList allowedActions, string targetObjectId, string targetObjectName, string targetInstanceType, SiteRecoveryJobDetails customDetails, IDictionary serializedAdditionalRawData) @@ -121,7 +121,7 @@ internal SiteRecoveryJobProperties(string activityId, string scenarioName, strin /// /// The custom job details like test failover job 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 . + /// The available derived classes include , , , , , , and . /// public SiteRecoveryJobDetails CustomDetails { get; } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.Serialization.cs index e210bae31b03..c82309a0bbe6 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.Serialization.cs @@ -64,6 +64,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("oSMinorVersion"u8); writer.WriteStringValue(OSMinorVersion); } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -107,6 +112,7 @@ internal static SiteRecoveryOSDetails DeserializeSiteRecoveryOSDetails(JsonEleme string osVersion = default; string osMajorVersion = default; string osMinorVersion = default; + string userSelectedOSName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -141,6 +147,11 @@ internal static SiteRecoveryOSDetails DeserializeSiteRecoveryOSDetails(JsonEleme osMinorVersion = property.Value.GetString(); continue; } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -154,6 +165,7 @@ internal static SiteRecoveryOSDetails DeserializeSiteRecoveryOSDetails(JsonEleme osVersion, osMajorVersion, osMinorVersion, + userSelectedOSName, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.cs index 5bdedabc2097..12b8d3dc819c 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SiteRecoveryOSDetails.cs @@ -57,8 +57,9 @@ internal SiteRecoveryOSDetails() /// The OS Version. /// The OS Major Version. /// The OS Minor Version. + /// The OS name selected by user. /// Keeps track of any properties unknown to the library. - internal SiteRecoveryOSDetails(string osType, string productType, string osEdition, string osVersion, string osMajorVersion, string osMinorVersion, IDictionary serializedAdditionalRawData) + internal SiteRecoveryOSDetails(string osType, string productType, string osEdition, string osVersion, string osMajorVersion, string osMinorVersion, string userSelectedOSName, IDictionary serializedAdditionalRawData) { OSType = osType; ProductType = productType; @@ -66,6 +67,7 @@ internal SiteRecoveryOSDetails(string osType, string productType, string osEditi OSVersion = osVersion; OSMajorVersion = osMajorVersion; OSMinorVersion = osMinorVersion; + UserSelectedOSName = userSelectedOSName; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -81,5 +83,7 @@ internal SiteRecoveryOSDetails(string osType, string productType, string osEditi public string OSMajorVersion { get; } /// The OS Minor Version. public string OSMinorVersion { get; } + /// The OS name selected by user. + public string UserSelectedOSName { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.Serialization.cs new file mode 100644 index 000000000000..14bc09269ec2 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.Serialization.cs @@ -0,0 +1,133 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class SwitchClusterProtectionContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwitchClusterProtectionContent)} does not support writing '{format}' format."); + } + + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwitchClusterProtectionContent 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(SwitchClusterProtectionContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwitchClusterProtectionContent(document.RootElement, options); + } + + internal static SwitchClusterProtectionContent DeserializeSwitchClusterProtectionContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SwitchClusterProtectionContentProperties properties = 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 = SwitchClusterProtectionContentProperties.DeserializeSwitchClusterProtectionContentProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwitchClusterProtectionContent(properties, 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(SwitchClusterProtectionContent)} does not support writing '{options.Format}' format."); + } + } + + SwitchClusterProtectionContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSwitchClusterProtectionContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwitchClusterProtectionContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.cs new file mode 100644 index 000000000000..8499306f3b05 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Switch cluster protection input. + public partial class SwitchClusterProtectionContent + { + /// + /// 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 SwitchClusterProtectionContent() + { + } + + /// Initializes a new instance of . + /// Switch cluster protection properties. + /// Keeps track of any properties unknown to the library. + internal SwitchClusterProtectionContent(SwitchClusterProtectionContentProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Switch cluster protection properties. + public SwitchClusterProtectionContentProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.Serialization.cs new file mode 100644 index 000000000000..ce92f7e818ff --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.Serialization.cs @@ -0,0 +1,144 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class SwitchClusterProtectionContentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwitchClusterProtectionContentProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ReplicationProtectionClusterName)) + { + writer.WritePropertyName("replicationProtectionClusterName"u8); + writer.WriteStringValue(ReplicationProtectionClusterName); + } + if (Optional.IsDefined(ProviderSpecificDetails)) + { + writer.WritePropertyName("providerSpecificDetails"u8); + writer.WriteObjectValue(ProviderSpecificDetails, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwitchClusterProtectionContentProperties 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(SwitchClusterProtectionContentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwitchClusterProtectionContentProperties(document.RootElement, options); + } + + internal static SwitchClusterProtectionContentProperties DeserializeSwitchClusterProtectionContentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string replicationProtectionClusterName = default; + SwitchClusterProtectionProviderSpecificContent providerSpecificDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("replicationProtectionClusterName"u8)) + { + replicationProtectionClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("providerSpecificDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + providerSpecificDetails = SwitchClusterProtectionProviderSpecificContent.DeserializeSwitchClusterProtectionProviderSpecificContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SwitchClusterProtectionContentProperties(replicationProtectionClusterName, providerSpecificDetails, 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(SwitchClusterProtectionContentProperties)} does not support writing '{options.Format}' format."); + } + } + + SwitchClusterProtectionContentProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSwitchClusterProtectionContentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwitchClusterProtectionContentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.cs new file mode 100644 index 000000000000..21a63786f34c --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionContentProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Switch cluster protection input properties. + public partial class SwitchClusterProtectionContentProperties + { + /// + /// 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 SwitchClusterProtectionContentProperties() + { + } + + /// Initializes a new instance of . + /// The unique replication protection cluster name. + /// + /// Provider specific switch protection input. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal SwitchClusterProtectionContentProperties(string replicationProtectionClusterName, SwitchClusterProtectionProviderSpecificContent providerSpecificDetails, IDictionary serializedAdditionalRawData) + { + ReplicationProtectionClusterName = replicationProtectionClusterName; + ProviderSpecificDetails = providerSpecificDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique replication protection cluster name. + public string ReplicationProtectionClusterName { get; set; } + /// + /// Provider specific switch protection input. + /// 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 . + /// + public SwitchClusterProtectionProviderSpecificContent ProviderSpecificDetails { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..4be95bfc529b --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + [PersistableModelProxy(typeof(UnknownSwitchClusterProtectionProviderSpecificContent))] + public partial class SwitchClusterProtectionProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwitchClusterProtectionProviderSpecificContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SwitchClusterProtectionProviderSpecificContent 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(SwitchClusterProtectionProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwitchClusterProtectionProviderSpecificContent(document.RootElement, options); + } + + internal static SwitchClusterProtectionProviderSpecificContent DeserializeSwitchClusterProtectionProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "A2A": return A2ASwitchClusterProtectionContent.DeserializeA2ASwitchClusterProtectionContent(element, options); + } + } + return UnknownSwitchClusterProtectionProviderSpecificContent.DeserializeUnknownSwitchClusterProtectionProviderSpecificContent(element, options); + } + + 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(SwitchClusterProtectionProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + SwitchClusterProtectionProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSwitchClusterProtectionProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwitchClusterProtectionProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.cs new file mode 100644 index 000000000000..8c208704b005 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/SwitchClusterProtectionProviderSpecificContent.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// + /// Provider specific switch cluster protection input. + /// 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 . + /// + public abstract partial class SwitchClusterProtectionProviderSpecificContent + { + /// + /// 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 SwitchClusterProtectionProviderSpecificContent() + { + } + + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal SwitchClusterProtectionProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the Instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..b941fd787608 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownApplyClusterRecoveryPointProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointProviderSpecificContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ApplyClusterRecoveryPointProviderSpecificContent 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(ApplyClusterRecoveryPointProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplyClusterRecoveryPointProviderSpecificContent(document.RootElement, options); + } + + internal static UnknownApplyClusterRecoveryPointProviderSpecificContent DeserializeUnknownApplyClusterRecoveryPointProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownApplyClusterRecoveryPointProviderSpecificContent(instanceType, 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(ApplyClusterRecoveryPointProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ApplyClusterRecoveryPointProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplyClusterRecoveryPointProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplyClusterRecoveryPointProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.cs new file mode 100644 index 000000000000..efb840de5b0f --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownApplyClusterRecoveryPointProviderSpecificContent.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of ApplyClusterRecoveryPointProviderSpecificInput. + internal partial class UnknownApplyClusterRecoveryPointProviderSpecificContent : ApplyClusterRecoveryPointProviderSpecificContent + { + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal UnknownApplyClusterRecoveryPointProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownApplyClusterRecoveryPointProviderSpecificContent() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.Serialization.cs new file mode 100644 index 000000000000..cf8788f37f81 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownClusterProviderSpecificRecoveryPointDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterProviderSpecificRecoveryPointDetails)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ClusterProviderSpecificRecoveryPointDetails 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(ClusterProviderSpecificRecoveryPointDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterProviderSpecificRecoveryPointDetails(document.RootElement, options); + } + + internal static UnknownClusterProviderSpecificRecoveryPointDetails DeserializeUnknownClusterProviderSpecificRecoveryPointDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownClusterProviderSpecificRecoveryPointDetails(instanceType, 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(ClusterProviderSpecificRecoveryPointDetails)} does not support writing '{options.Format}' format."); + } + } + + ClusterProviderSpecificRecoveryPointDetails 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterProviderSpecificRecoveryPointDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterProviderSpecificRecoveryPointDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.cs new file mode 100644 index 000000000000..9d9b5ce706de --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterProviderSpecificRecoveryPointDetails.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of ClusterProviderSpecificRecoveryPointDetails. + internal partial class UnknownClusterProviderSpecificRecoveryPointDetails : ClusterProviderSpecificRecoveryPointDetails + { + /// Initializes a new instance of . + /// Gets the provider type. + /// Keeps track of any properties unknown to the library. + internal UnknownClusterProviderSpecificRecoveryPointDetails(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownClusterProviderSpecificRecoveryPointDetails() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..bf4c0e3fe857 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownClusterTestFailoverProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterTestFailoverProviderSpecificContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ClusterTestFailoverProviderSpecificContent 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(ClusterTestFailoverProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterTestFailoverProviderSpecificContent(document.RootElement, options); + } + + internal static UnknownClusterTestFailoverProviderSpecificContent DeserializeUnknownClusterTestFailoverProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownClusterTestFailoverProviderSpecificContent(instanceType, 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(ClusterTestFailoverProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterTestFailoverProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterTestFailoverProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterTestFailoverProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.cs new file mode 100644 index 000000000000..436da4894648 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterTestFailoverProviderSpecificContent.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of ClusterTestFailoverProviderSpecificInput. + internal partial class UnknownClusterTestFailoverProviderSpecificContent : ClusterTestFailoverProviderSpecificContent + { + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal UnknownClusterTestFailoverProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownClusterTestFailoverProviderSpecificContent() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..4450a8f39d57 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownClusterUnplannedFailoverProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverProviderSpecificContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ClusterUnplannedFailoverProviderSpecificContent 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(ClusterUnplannedFailoverProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeClusterUnplannedFailoverProviderSpecificContent(document.RootElement, options); + } + + internal static UnknownClusterUnplannedFailoverProviderSpecificContent DeserializeUnknownClusterUnplannedFailoverProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownClusterUnplannedFailoverProviderSpecificContent(instanceType, 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(ClusterUnplannedFailoverProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + ClusterUnplannedFailoverProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeClusterUnplannedFailoverProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ClusterUnplannedFailoverProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.cs new file mode 100644 index 000000000000..c0203606e2c4 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownClusterUnplannedFailoverProviderSpecificContent.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of ClusterUnplannedFailoverProviderSpecificInput. + internal partial class UnknownClusterUnplannedFailoverProviderSpecificContent : ClusterUnplannedFailoverProviderSpecificContent + { + /// Initializes a new instance of . + /// The class type. + /// Keeps track of any properties unknown to the library. + internal UnknownClusterUnplannedFailoverProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownClusterUnplannedFailoverProviderSpecificContent() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.Serialization.cs new file mode 100644 index 000000000000..7077100fe953 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownReplicationClusterProviderSpecificSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationClusterProviderSpecificSettings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ReplicationClusterProviderSpecificSettings 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(ReplicationClusterProviderSpecificSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationClusterProviderSpecificSettings(document.RootElement, options); + } + + internal static UnknownReplicationClusterProviderSpecificSettings DeserializeUnknownReplicationClusterProviderSpecificSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownReplicationClusterProviderSpecificSettings(instanceType, 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(ReplicationClusterProviderSpecificSettings)} does not support writing '{options.Format}' format."); + } + } + + ReplicationClusterProviderSpecificSettings 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationClusterProviderSpecificSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationClusterProviderSpecificSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.cs new file mode 100644 index 000000000000..284bdf97449b --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownReplicationClusterProviderSpecificSettings.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of ReplicationClusterProviderSpecificSettings. + internal partial class UnknownReplicationClusterProviderSpecificSettings : ReplicationClusterProviderSpecificSettings + { + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal UnknownReplicationClusterProviderSpecificSettings(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownReplicationClusterProviderSpecificSettings() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.Serialization.cs new file mode 100644 index 000000000000..380ae328221a --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownSharedDiskReplicationProviderSpecificSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedDiskReplicationProviderSpecificSettings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SharedDiskReplicationProviderSpecificSettings 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(SharedDiskReplicationProviderSpecificSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedDiskReplicationProviderSpecificSettings(document.RootElement, options); + } + + internal static UnknownSharedDiskReplicationProviderSpecificSettings DeserializeUnknownSharedDiskReplicationProviderSpecificSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSharedDiskReplicationProviderSpecificSettings(instanceType, 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(SharedDiskReplicationProviderSpecificSettings)} does not support writing '{options.Format}' format."); + } + } + + SharedDiskReplicationProviderSpecificSettings 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSharedDiskReplicationProviderSpecificSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedDiskReplicationProviderSpecificSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.cs new file mode 100644 index 000000000000..a3b5a3af6274 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSharedDiskReplicationProviderSpecificSettings.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of SharedDiskReplicationProviderSpecificSettings. + internal partial class UnknownSharedDiskReplicationProviderSpecificSettings : SharedDiskReplicationProviderSpecificSettings + { + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal UnknownSharedDiskReplicationProviderSpecificSettings(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSharedDiskReplicationProviderSpecificSettings() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.Serialization.cs new file mode 100644 index 000000000000..e52c3203f0b9 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.Serialization.cs @@ -0,0 +1,110 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + internal partial class UnknownSwitchClusterProtectionProviderSpecificContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SwitchClusterProtectionProviderSpecificContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SwitchClusterProtectionProviderSpecificContent 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(SwitchClusterProtectionProviderSpecificContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSwitchClusterProtectionProviderSpecificContent(document.RootElement, options); + } + + internal static UnknownSwitchClusterProtectionProviderSpecificContent DeserializeUnknownSwitchClusterProtectionProviderSpecificContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSwitchClusterProtectionProviderSpecificContent(instanceType, 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(SwitchClusterProtectionProviderSpecificContent)} does not support writing '{options.Format}' format."); + } + } + + SwitchClusterProtectionProviderSpecificContent 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSwitchClusterProtectionProviderSpecificContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SwitchClusterProtectionProviderSpecificContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.cs new file mode 100644 index 000000000000..befaa7a16fce --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UnknownSwitchClusterProtectionProviderSpecificContent.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Unknown version of SwitchClusterProtectionProviderSpecificInput. + internal partial class UnknownSwitchClusterProtectionProviderSpecificContent : SwitchClusterProtectionProviderSpecificContent + { + /// Initializes a new instance of . + /// Gets the Instance type. + /// Keeps track of any properties unknown to the library. + internal UnknownSwitchClusterProtectionProviderSpecificContent(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSwitchClusterProtectionProviderSpecificContent() + { + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.Serialization.cs index ad0a18794440..a4aefec15628 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.Serialization.cs @@ -41,6 +41,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("targetDiskName"u8); writer.WriteStringValue(TargetDiskName); } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -80,6 +95,9 @@ internal static UpdateDiskContent DeserializeUpdateDiskContent(JsonElement eleme } string diskId = default; string targetDiskName = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,13 +112,46 @@ internal static UpdateDiskContent DeserializeUpdateDiskContent(JsonElement eleme targetDiskName = property.Value.GetString(); continue; } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new UpdateDiskContent(diskId, targetDiskName, serializedAdditionalRawData); + return new UpdateDiskContent( + diskId, + targetDiskName, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.cs index 6f3b03fdf4d8..42623b841bb9 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UpdateDiskContent.cs @@ -58,11 +58,17 @@ public UpdateDiskContent(string diskId) /// Initializes a new instance of . /// The disk Id. /// The target disk name. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal UpdateDiskContent(string diskId, string targetDiskName, IDictionary serializedAdditionalRawData) + internal UpdateDiskContent(string diskId, string targetDiskName, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; TargetDiskName = targetDiskName; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -75,5 +81,11 @@ internal UpdateDiskContent() public string DiskId { get; } /// The target disk name. public string TargetDiskName { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.Serialization.cs new file mode 100644 index 000000000000..232d4a2b2791 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.Serialization.cs @@ -0,0 +1,140 @@ +// 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.RecoveryServicesSiteRecovery.Models +{ + public partial class UserCreatedResourceTag : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UserCreatedResourceTag)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TagName)) + { + writer.WritePropertyName("tagName"u8); + writer.WriteStringValue(TagName); + } + if (Optional.IsDefined(TagValue)) + { + writer.WritePropertyName("tagValue"u8); + writer.WriteStringValue(TagValue); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UserCreatedResourceTag 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(UserCreatedResourceTag)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserCreatedResourceTag(document.RootElement, options); + } + + internal static UserCreatedResourceTag DeserializeUserCreatedResourceTag(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tagName = default; + string tagValue = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tagName"u8)) + { + tagName = property.Value.GetString(); + continue; + } + if (property.NameEquals("tagValue"u8)) + { + tagValue = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserCreatedResourceTag(tagName, tagValue, 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(UserCreatedResourceTag)} does not support writing '{options.Format}' format."); + } + } + + UserCreatedResourceTag 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUserCreatedResourceTag(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserCreatedResourceTag)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.cs new file mode 100644 index 000000000000..ab086478a0d2 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/UserCreatedResourceTag.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery.Models +{ + /// Resource tag input. + public partial class UserCreatedResourceTag + { + /// + /// 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 UserCreatedResourceTag() + { + } + + /// Initializes a new instance of . + /// The tag name. Please read for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations. + /// The tag value. Please read her for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations. + /// Keeps track of any properties unknown to the library. + internal UserCreatedResourceTag(string tagName, string tagValue, IDictionary serializedAdditionalRawData) + { + TagName = tagName; + TagValue = tagValue; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The tag name. Please read for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations. + public string TagName { get; set; } + /// The tag value. Please read her for more information: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations. + public string TagValue { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.Serialization.cs index 283618daab3b..48eeda44a124 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.Serialization.cs @@ -52,6 +52,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("diskEncryptionSetId"u8); writer.WriteStringValue(DiskEncryptionSetId); } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -95,6 +115,10 @@ internal static VMwareCbtDiskContent DeserializeVMwareCbtDiskContent(JsonElement ResourceIdentifier logStorageAccountId = default; string logStorageAccountSasSecretName = default; ResourceIdentifier diskEncryptionSetId = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -137,6 +161,42 @@ internal static VMwareCbtDiskContent DeserializeVMwareCbtDiskContent(JsonElement diskEncryptionSetId = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -150,6 +210,10 @@ internal static VMwareCbtDiskContent DeserializeVMwareCbtDiskContent(JsonElement logStorageAccountId, logStorageAccountSasSecretName, diskEncryptionSetId, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.cs index 46a868244b45..85739b06e6e4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtDiskContent.cs @@ -72,8 +72,12 @@ public VMwareCbtDiskContent(string diskId, string isOSDisk, ResourceIdentifier l /// The log storage account ARM Id. /// The key vault secret name of the log storage account. /// The DiskEncryptionSet ARM Id. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal VMwareCbtDiskContent(string diskId, SiteRecoveryDiskAccountType? diskType, string isOSDisk, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, IDictionary serializedAdditionalRawData) + internal VMwareCbtDiskContent(string diskId, SiteRecoveryDiskAccountType? diskType, string isOSDisk, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; DiskType = diskType; @@ -81,6 +85,10 @@ internal VMwareCbtDiskContent(string diskId, SiteRecoveryDiskAccountType? diskTy LogStorageAccountId = logStorageAccountId; LogStorageAccountSasSecretName = logStorageAccountSasSecretName; DiskEncryptionSetId = diskEncryptionSetId; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -101,5 +109,13 @@ internal VMwareCbtDiskContent() public string LogStorageAccountSasSecretName { get; } /// The DiskEncryptionSet ARM Id. public ResourceIdentifier DiskEncryptionSetId { get; set; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.Serialization.cs index 1ce90030d406..54b3a99f9afc 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.Serialization.cs @@ -54,6 +54,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } if (Optional.IsDefined(PerformSqlBulkRegistration)) { writer.WritePropertyName("performSqlBulkRegistration"u8); @@ -171,6 +176,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndObject(); } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } } VMwareCbtEnableMigrationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -197,6 +207,7 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat IList disksToInclude = default; SiteRecoveryLicenseType? licenseType = default; SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; string performSqlBulkRegistration = default; ResourceIdentifier dataMoverRunAsAccountId = default; ResourceIdentifier snapshotRunAsAccountId = default; @@ -218,6 +229,7 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat IDictionary seedDiskTags = default; IDictionary targetDiskTags = default; IDictionary targetNicTags = default; + string userSelectedOSName = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -256,6 +268,15 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } if (property.NameEquals("performSqlBulkRegistration"u8)) { performSqlBulkRegistration = property.Value.GetString(); @@ -421,6 +442,11 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat targetNicTags = dictionary; continue; } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -439,6 +465,7 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat disksToInclude, licenseType, sqlServerLicenseType, + linuxLicenseType, performSqlBulkRegistration, dataMoverRunAsAccountId, snapshotRunAsAccountId, @@ -459,7 +486,8 @@ internal static VMwareCbtEnableMigrationContent DeserializeVMwareCbtEnableMigrat targetVmTags ?? new ChangeTrackingDictionary(), seedDiskTags ?? new ChangeTrackingDictionary(), targetDiskTags ?? new ChangeTrackingDictionary(), - targetNicTags ?? new ChangeTrackingDictionary()); + targetNicTags ?? new ChangeTrackingDictionary(), + userSelectedOSName); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.cs index 9f859bc3b7c1..2c4cd64b0aaa 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtEnableMigrationContent.cs @@ -52,6 +52,7 @@ public VMwareCbtEnableMigrationContent(ResourceIdentifier vmwareMachineId, IEnum /// The disks to include list. /// License type. /// The SQL Server license type. + /// The license type for Linux VM's. /// A value indicating whether bulk SQL RP registration to be done. /// The data mover run as account Id. /// The snapshot run as account Id. @@ -73,12 +74,14 @@ public VMwareCbtEnableMigrationContent(ResourceIdentifier vmwareMachineId, IEnum /// The tags for the seed disks. /// The tags for the target disks. /// The tags for the target NICs. - internal VMwareCbtEnableMigrationContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareMachineId, IList disksToInclude, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, string performSqlBulkRegistration, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string performAutoResync, IDictionary targetVmTags, IDictionary seedDiskTags, IDictionary targetDiskTags, IDictionary targetNicTags) : base(instanceType, serializedAdditionalRawData) + /// The OS name selected by user. + internal VMwareCbtEnableMigrationContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareMachineId, IList disksToInclude, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, string performSqlBulkRegistration, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, string targetSubnetName, string testSubnetName, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, string performAutoResync, IDictionary targetVmTags, IDictionary seedDiskTags, IDictionary targetDiskTags, IDictionary targetNicTags, string userSelectedOSName) : base(instanceType, serializedAdditionalRawData) { VMwareMachineId = vmwareMachineId; DisksToInclude = disksToInclude; LicenseType = licenseType; SqlServerLicenseType = sqlServerLicenseType; + LinuxLicenseType = linuxLicenseType; PerformSqlBulkRegistration = performSqlBulkRegistration; DataMoverRunAsAccountId = dataMoverRunAsAccountId; SnapshotRunAsAccountId = snapshotRunAsAccountId; @@ -100,6 +103,7 @@ internal VMwareCbtEnableMigrationContent(string instanceType, IDictionary The SQL Server license type. public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } /// A value indicating whether bulk SQL RP registration to be done. public string PerformSqlBulkRegistration { get; set; } /// The data mover run as account Id. @@ -158,5 +164,7 @@ internal VMwareCbtEnableMigrationContent() public IDictionary TargetDiskTags { get; } /// The tags for the target NICs. public IDictionary TargetNicTags { get; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.Serialization.cs index 76becceddc6f..0f15f256289b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.Serialization.cs @@ -42,6 +42,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("osUpgradeVersion"u8); writer.WriteStringValue(OSUpgradeVersion); } + if (Optional.IsCollectionDefined(PostMigrationSteps)) + { + writer.WritePropertyName("postMigrationSteps"u8); + writer.WriteStartArray(); + foreach (var item in PostMigrationSteps) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } } VMwareCbtMigrateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -66,6 +76,7 @@ internal static VMwareCbtMigrateContent DeserializeVMwareCbtMigrateContent(JsonE } string performShutdown = default; string osUpgradeVersion = default; + IList postMigrationSteps = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -81,6 +92,20 @@ internal static VMwareCbtMigrateContent DeserializeVMwareCbtMigrateContent(JsonE osUpgradeVersion = property.Value.GetString(); continue; } + if (property.NameEquals("postMigrationSteps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedRunCommandScriptContent.DeserializeManagedRunCommandScriptContent(item, options)); + } + postMigrationSteps = array; + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -92,7 +117,7 @@ internal static VMwareCbtMigrateContent DeserializeVMwareCbtMigrateContent(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new VMwareCbtMigrateContent(instanceType, serializedAdditionalRawData, performShutdown, osUpgradeVersion); + return new VMwareCbtMigrateContent(instanceType, serializedAdditionalRawData, performShutdown, osUpgradeVersion, postMigrationSteps ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.cs index d25bbac45b77..1b7d817130b7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrateContent.cs @@ -21,6 +21,7 @@ public VMwareCbtMigrateContent(string performShutdown) Argument.AssertNotNull(performShutdown, nameof(performShutdown)); PerformShutdown = performShutdown; + PostMigrationSteps = new ChangeTrackingList(); InstanceType = "VMwareCbt"; } @@ -29,10 +30,12 @@ public VMwareCbtMigrateContent(string performShutdown) /// Keeps track of any properties unknown to the library. /// A value indicating whether VM is to be shutdown. /// A value indicating the inplace OS Upgrade version. - internal VMwareCbtMigrateContent(string instanceType, IDictionary serializedAdditionalRawData, string performShutdown, string osUpgradeVersion) : base(instanceType, serializedAdditionalRawData) + /// The managed run command script input. + internal VMwareCbtMigrateContent(string instanceType, IDictionary serializedAdditionalRawData, string performShutdown, string osUpgradeVersion, IList postMigrationSteps) : base(instanceType, serializedAdditionalRawData) { PerformShutdown = performShutdown; OSUpgradeVersion = osUpgradeVersion; + PostMigrationSteps = postMigrationSteps; InstanceType = instanceType ?? "VMwareCbt"; } @@ -45,5 +48,7 @@ internal VMwareCbtMigrateContent() public string PerformShutdown { get; } /// A value indicating the inplace OS Upgrade version. public string OSUpgradeVersion { get; set; } + /// The managed run command script input. + public IList PostMigrationSteps { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.Serialization.cs index 2a4a548ad435..78094db2d48f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.Serialization.cs @@ -70,6 +70,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } if (options.Format != "W" && Optional.IsDefined(DataMoverRunAsAccountId)) { writer.WritePropertyName("dataMoverRunAsAccountId"u8); @@ -343,6 +348,7 @@ internal static VMwareCbtMigrationDetails DeserializeVMwareCbtMigrationDetails(J string targetGeneration = default; string licenseType = default; string sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; ResourceIdentifier dataMoverRunAsAccountId = default; ResourceIdentifier snapshotRunAsAccountId = default; ResourceIdentifier storageAccountId = default; @@ -428,6 +434,15 @@ internal static VMwareCbtMigrationDetails DeserializeVMwareCbtMigrationDetails(J sqlServerLicenseType = property.Value.GetString(); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } if (property.NameEquals("dataMoverRunAsAccountId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -821,6 +836,7 @@ internal static VMwareCbtMigrationDetails DeserializeVMwareCbtMigrationDetails(J targetGeneration, licenseType, sqlServerLicenseType, + linuxLicenseType, dataMoverRunAsAccountId, snapshotRunAsAccountId, storageAccountId, diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.cs index 62445a1c3fad..544733fb7289 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtMigrationDetails.cs @@ -37,6 +37,7 @@ internal VMwareCbtMigrationDetails() /// The target generation. /// License Type of the VM to be used. /// The SQL Server license type. + /// The license type for Linux VM's. /// The data mover run as account Id. /// The snapshot run as account Id. /// The replication storage account ARM Id. This is applicable only for the blob based replication test hook. @@ -78,7 +79,7 @@ internal VMwareCbtMigrationDetails() /// A value indicating the appliance monitoring details. /// A value indicating the gateway operation details. /// A value indicating the SRS operation name. - internal VMwareCbtMigrationDetails(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IReadOnlyList protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IReadOnlyList vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, int? deltaSyncProgressPercentage, string isCheckSumResyncCycle, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, long? deltaSyncRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IReadOnlyList supportedOSVersions, ApplianceMonitoringDetails applianceMonitoringDetails, GatewayOperationDetails gatewayOperationDetails, string operationName) : base(instanceType, serializedAdditionalRawData) + internal VMwareCbtMigrationDetails(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareMachineId, string osType, string osName, string firmwareType, string targetGeneration, string licenseType, string sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, ResourceIdentifier dataMoverRunAsAccountId, ResourceIdentifier snapshotRunAsAccountId, ResourceIdentifier storageAccountId, string targetVmName, string targetVmSize, string targetLocation, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier confidentialVmKeyVaultId, VMwareCbtSecurityProfileProperties targetVmSecurityProfile, ResourceIdentifier targetBootDiagnosticsStorageAccountId, IReadOnlyDictionary targetVmTags, IReadOnlyList protectedDisks, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IReadOnlyList vmNics, IReadOnlyDictionary targetNicTags, ResourceIdentifier migrationRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, ResourceIdentifier lastRecoveryPointId, int? initialSeedingProgressPercentage, int? migrationProgressPercentage, int? resyncProgressPercentage, int? resumeProgressPercentage, int? deltaSyncProgressPercentage, string isCheckSumResyncCycle, long? initialSeedingRetryCount, long? resyncRetryCount, long? resumeRetryCount, long? deltaSyncRetryCount, string resyncRequired, SiteRecoveryResyncState? resyncState, string performAutoResync, IReadOnlyDictionary seedDiskTags, IReadOnlyDictionary targetDiskTags, IReadOnlyList supportedOSVersions, ApplianceMonitoringDetails applianceMonitoringDetails, GatewayOperationDetails gatewayOperationDetails, string operationName) : base(instanceType, serializedAdditionalRawData) { VMwareMachineId = vmwareMachineId; OSType = osType; @@ -87,6 +88,7 @@ internal VMwareCbtMigrationDetails(string instanceType, IDictionary The SQL Server license type. public string SqlServerLicenseType { get; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; } /// The data mover run as account Id. public ResourceIdentifier DataMoverRunAsAccountId { get; } /// The snapshot run as account Id. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.Serialization.cs index 01e0620eba36..cc0ee59010e1 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.Serialization.cs @@ -109,6 +109,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("gatewayOperationDetails"u8); writer.WriteObjectValue(GatewayOperationDetails, options); } + if (Optional.IsDefined(SectorSizeInBytes)) + { + writer.WritePropertyName("sectorSizeInBytes"u8); + writer.WriteNumberValue(SectorSizeInBytes.Value); + } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -161,6 +181,10 @@ internal static VMwareCbtProtectedDiskDetails DeserializeVMwareCbtProtectedDiskD Uri targetBlobUri = default; string targetDiskName = default; GatewayOperationDetails gatewayOperationDetails = default; + int? sectorSizeInBytes = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -268,6 +292,42 @@ internal static VMwareCbtProtectedDiskDetails DeserializeVMwareCbtProtectedDiskD gatewayOperationDetails = GatewayOperationDetails.DeserializeGatewayOperationDetails(property.Value, options); continue; } + if (property.NameEquals("sectorSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sectorSizeInBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -290,6 +350,10 @@ internal static VMwareCbtProtectedDiskDetails DeserializeVMwareCbtProtectedDiskD targetBlobUri, targetDiskName, gatewayOperationDetails, + sectorSizeInBytes, + iops, + throughputInMbps, + diskSizeInGB, serializedAdditionalRawData); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.cs index c00a4257de47..f87e0f3c21b8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtProtectedDiskDetails.cs @@ -67,8 +67,12 @@ internal VMwareCbtProtectedDiskDetails() /// The uri of the target blob. /// The name for the target managed disk. /// A value indicating the gateway operation details. + /// The logical sector size (in bytes), 512 by default. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName, GatewayOperationDetails gatewayOperationDetails, IDictionary serializedAdditionalRawData) + internal VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecoveryDiskAccountType? diskType, string diskPath, string isOSDisk, long? capacityInBytes, ResourceIdentifier logStorageAccountId, string logStorageAccountSasSecretName, ResourceIdentifier diskEncryptionSetId, string seedManagedDiskId, Uri seedBlobUri, string targetManagedDiskId, Uri targetBlobUri, string targetDiskName, GatewayOperationDetails gatewayOperationDetails, int? sectorSizeInBytes, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; DiskName = diskName; @@ -85,6 +89,10 @@ internal VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecov TargetBlobUri = targetBlobUri; TargetDiskName = targetDiskName; GatewayOperationDetails = gatewayOperationDetails; + SectorSizeInBytes = sectorSizeInBytes; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -118,5 +126,13 @@ internal VMwareCbtProtectedDiskDetails(string diskId, string diskName, SiteRecov public string TargetDiskName { get; } /// A value indicating the gateway operation details. public GatewayOperationDetails GatewayOperationDetails { get; } + /// The logical sector size (in bytes), 512 by default. + public int? SectorSizeInBytes { get; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.Serialization.cs index de1f12c42a82..5f537063a051 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.Serialization.cs @@ -54,6 +54,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("osUpgradeVersion"u8); writer.WriteStringValue(OSUpgradeVersion); } + if (Optional.IsCollectionDefined(PostMigrationSteps)) + { + writer.WritePropertyName("postMigrationSteps"u8); + writer.WriteStartArray(); + foreach (var item in PostMigrationSteps) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } } VMwareCbtTestMigrateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -80,6 +90,7 @@ internal static VMwareCbtTestMigrateContent DeserializeVMwareCbtTestMigrateConte ResourceIdentifier networkId = default; IList vmNics = default; string osUpgradeVersion = default; + IList postMigrationSteps = default; string instanceType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -114,6 +125,20 @@ internal static VMwareCbtTestMigrateContent DeserializeVMwareCbtTestMigrateConte osUpgradeVersion = property.Value.GetString(); continue; } + if (property.NameEquals("postMigrationSteps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedRunCommandScriptContent.DeserializeManagedRunCommandScriptContent(item, options)); + } + postMigrationSteps = array; + continue; + } if (property.NameEquals("instanceType"u8)) { instanceType = property.Value.GetString(); @@ -131,7 +156,8 @@ internal static VMwareCbtTestMigrateContent DeserializeVMwareCbtTestMigrateConte recoveryPointId, networkId, vmNics ?? new ChangeTrackingList(), - osUpgradeVersion); + osUpgradeVersion, + postMigrationSteps ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.cs index 89438ff950d0..ceb07ab5e952 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtTestMigrateContent.cs @@ -26,6 +26,7 @@ public VMwareCbtTestMigrateContent(ResourceIdentifier recoveryPointId, ResourceI RecoveryPointId = recoveryPointId; NetworkId = networkId; VmNics = new ChangeTrackingList(); + PostMigrationSteps = new ChangeTrackingList(); InstanceType = "VMwareCbt"; } @@ -36,12 +37,14 @@ public VMwareCbtTestMigrateContent(ResourceIdentifier recoveryPointId, ResourceI /// The test network Id. /// The list of NIC details. /// A value indicating the inplace OS Upgrade version. - internal VMwareCbtTestMigrateContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier recoveryPointId, ResourceIdentifier networkId, IList vmNics, string osUpgradeVersion) : base(instanceType, serializedAdditionalRawData) + /// The managed run command script input. + internal VMwareCbtTestMigrateContent(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier recoveryPointId, ResourceIdentifier networkId, IList vmNics, string osUpgradeVersion, IList postMigrationSteps) : base(instanceType, serializedAdditionalRawData) { RecoveryPointId = recoveryPointId; NetworkId = networkId; VmNics = vmNics; OSUpgradeVersion = osUpgradeVersion; + PostMigrationSteps = postMigrationSteps; InstanceType = instanceType ?? "VMwareCbt"; } @@ -58,5 +61,7 @@ internal VMwareCbtTestMigrateContent() public IList VmNics { get; } /// A value indicating the inplace OS Upgrade version. public string OSUpgradeVersion { get; set; } + /// The managed run command script input. + public IList PostMigrationSteps { get; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.Serialization.cs index 1a16efd70a8a..b5371599fdcb 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.Serialization.cs @@ -46,6 +46,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("isOSDisk"u8); writer.WriteStringValue(IsOSDisk); } + if (Optional.IsDefined(Iops)) + { + writer.WritePropertyName("iops"u8); + writer.WriteNumberValue(Iops.Value); + } + if (Optional.IsDefined(ThroughputInMbps)) + { + writer.WritePropertyName("throughputInMbps"u8); + writer.WriteNumberValue(ThroughputInMbps.Value); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeInGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,6 +101,9 @@ internal static VMwareCbtUpdateDiskContent DeserializeVMwareCbtUpdateDiskContent string diskId = default; string targetDiskName = default; string isOSDisk = default; + long? iops = default; + long? throughputInMbps = default; + long? diskSizeInGB = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,13 +123,47 @@ internal static VMwareCbtUpdateDiskContent DeserializeVMwareCbtUpdateDiskContent isOSDisk = property.Value.GetString(); continue; } + if (property.NameEquals("iops"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iops = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("throughputInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputInMbps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskSizeInGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeInGB = property.Value.GetInt64(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new VMwareCbtUpdateDiskContent(diskId, targetDiskName, isOSDisk, serializedAdditionalRawData); + return new VMwareCbtUpdateDiskContent( + diskId, + targetDiskName, + isOSDisk, + iops, + throughputInMbps, + diskSizeInGB, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.cs index 1fc36515e447..a6bdccc94ccf 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateDiskContent.cs @@ -59,12 +59,18 @@ public VMwareCbtUpdateDiskContent(string diskId) /// The disk Id. /// The target disk name. /// A value indicating whether the disk is the OS disk. + /// The number of IOPS allowed for Premium V2 and Ultra disks. + /// The total throughput in Mbps for Premium V2 and Ultra disks. + /// The target disk size in GB. /// Keeps track of any properties unknown to the library. - internal VMwareCbtUpdateDiskContent(string diskId, string targetDiskName, string isOSDisk, IDictionary serializedAdditionalRawData) + internal VMwareCbtUpdateDiskContent(string diskId, string targetDiskName, string isOSDisk, long? iops, long? throughputInMbps, long? diskSizeInGB, IDictionary serializedAdditionalRawData) { DiskId = diskId; TargetDiskName = targetDiskName; IsOSDisk = isOSDisk; + Iops = iops; + ThroughputInMbps = throughputInMbps; + DiskSizeInGB = diskSizeInGB; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -79,5 +85,11 @@ internal VMwareCbtUpdateDiskContent() public string TargetDiskName { get; set; } /// A value indicating whether the disk is the OS disk. public string IsOSDisk { get; set; } + /// The number of IOPS allowed for Premium V2 and Ultra disks. + public long? Iops { get; set; } + /// The total throughput in Mbps for Premium V2 and Ultra disks. + public long? ThroughputInMbps { get; set; } + /// The target disk size in GB. + public long? DiskSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.Serialization.cs index c9e99f06409e..1e8c6053ea38 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.Serialization.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.Serialization.cs @@ -110,6 +110,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("sqlServerLicenseType"u8); writer.WriteStringValue(SqlServerLicenseType.Value.ToString()); } + if (Optional.IsDefined(LinuxLicenseType)) + { + writer.WritePropertyName("linuxLicenseType"u8); + writer.WriteStringValue(LinuxLicenseType.Value.ToString()); + } + if (Optional.IsDefined(UserSelectedOSName)) + { + writer.WritePropertyName("userSelectedOSName"u8); + writer.WriteStringValue(UserSelectedOSName); + } if (Optional.IsDefined(PerformAutoResync)) { writer.WritePropertyName("performAutoResync"u8); @@ -183,6 +193,8 @@ internal static VMwareCbtUpdateMigrationItemContent DeserializeVMwareCbtUpdateMi IList vmDisks = default; SiteRecoveryLicenseType? licenseType = default; SiteRecoverySqlServerLicenseType? sqlServerLicenseType = default; + LinuxLicenseType? linuxLicenseType = default; + string userSelectedOSName = default; string performAutoResync = default; IDictionary targetVmTags = default; IDictionary targetDiskTags = default; @@ -307,6 +319,20 @@ internal static VMwareCbtUpdateMigrationItemContent DeserializeVMwareCbtUpdateMi sqlServerLicenseType = new SiteRecoverySqlServerLicenseType(property.Value.GetString()); continue; } + if (property.NameEquals("linuxLicenseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxLicenseType = new LinuxLicenseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userSelectedOSName"u8)) + { + userSelectedOSName = property.Value.GetString(); + continue; + } if (property.NameEquals("performAutoResync"u8)) { performAutoResync = property.Value.GetString(); @@ -381,6 +407,8 @@ internal static VMwareCbtUpdateMigrationItemContent DeserializeVMwareCbtUpdateMi vmDisks ?? new ChangeTrackingList(), licenseType, sqlServerLicenseType, + linuxLicenseType, + userSelectedOSName, performAutoResync, targetVmTags ?? new ChangeTrackingDictionary(), targetDiskTags ?? new ChangeTrackingDictionary(), diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.cs index 186ab3a1c220..cd83820f9370 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/Models/VMwareCbtUpdateMigrationItemContent.cs @@ -41,11 +41,13 @@ public VMwareCbtUpdateMigrationItemContent() /// The list of disk update properties. /// The license type. /// The SQL Server license type. + /// The license type for Linux VM's. + /// The OS name selected by user. /// A value indicating whether auto resync is to be done. /// The target VM tags. /// The tags for the target disks. /// The tags for the target NICs. - internal VMwareCbtUpdateMigrationItemContent(string instanceType, IDictionary serializedAdditionalRawData, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IList vmNics, IList vmDisks, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, string performAutoResync, IDictionary targetVmTags, IDictionary targetDiskTags, IDictionary targetNicTags) : base(instanceType, serializedAdditionalRawData) + internal VMwareCbtUpdateMigrationItemContent(string instanceType, IDictionary serializedAdditionalRawData, string targetVmName, string targetVmSize, ResourceIdentifier targetResourceGroupId, ResourceIdentifier targetAvailabilitySetId, string targetAvailabilityZone, ResourceIdentifier targetProximityPlacementGroupId, ResourceIdentifier targetBootDiagnosticsStorageAccountId, ResourceIdentifier targetNetworkId, ResourceIdentifier testNetworkId, IList vmNics, IList vmDisks, SiteRecoveryLicenseType? licenseType, SiteRecoverySqlServerLicenseType? sqlServerLicenseType, LinuxLicenseType? linuxLicenseType, string userSelectedOSName, string performAutoResync, IDictionary targetVmTags, IDictionary targetDiskTags, IDictionary targetNicTags) : base(instanceType, serializedAdditionalRawData) { TargetVmName = targetVmName; TargetVmSize = targetVmSize; @@ -60,6 +62,8 @@ internal VMwareCbtUpdateMigrationItemContent(string instanceType, IDictionary The SQL Server license type. public SiteRecoverySqlServerLicenseType? SqlServerLicenseType { get; set; } + /// The license type for Linux VM's. + public LinuxLicenseType? LinuxLicenseType { get; set; } + /// The OS name selected by user. + public string UserSelectedOSName { get; set; } /// A value indicating whether auto resync is to be done. public string PerformAutoResync { get; set; } /// The target VM tags. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingCollection.cs index c02f711fd306..a96ff4547c41 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mappingNa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string mappingName, Cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string mappingName, CancellationToken cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingResource.cs index 69fe3279981e..6f535e3fd18e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ProtectionContainerMappingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -406,7 +406,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, RemoveP /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultCollection.cs index 493c4567dc72..cb8ca762626c 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultCollection.cs @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -150,7 +150,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -246,7 +246,7 @@ public virtual async Task> ExistsAsync(CancellationToken cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual Response Exists(CancellationToken cancellationToken = defau /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultResource.cs index ff535662bb4a..6c591591401a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationEligibilityResultResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemCollection.cs index 0c121ceb6353..e98349b641b8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string replicatedP /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string replicatedProtected /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string replicatedProtectedItemName, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs index a8562429a466..30d004ff87f7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectedItemResource.cs @@ -116,7 +116,7 @@ public virtual SiteRecoveryPointCollection GetSiteRecoveryPoints() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual async Task> GetSiteRecoveryPo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -178,7 +178,7 @@ public virtual Response GetSiteRecoveryPoint(string r /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -342,7 +342,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -388,7 +388,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -434,7 +434,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -480,7 +480,7 @@ public virtual async Task> AddDis /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -526,7 +526,7 @@ public virtual ArmOperation AddDisks(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -572,7 +572,7 @@ public virtual async Task> ApplyR /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -618,7 +618,7 @@ public virtual ArmOperation ApplyRecoveryPoint /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -660,7 +660,7 @@ public virtual async Task> Failov /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -702,7 +702,7 @@ public virtual ArmOperation FailoverCancel(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -744,7 +744,7 @@ public virtual async Task> Failov /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -786,7 +786,7 @@ public virtual ArmOperation FailoverCommit(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -832,7 +832,7 @@ public virtual async Task> Planne /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -878,7 +878,7 @@ public virtual ArmOperation PlannedFailover(Wa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -924,7 +924,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Disable /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -970,7 +970,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, DisableProtectionContent /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1016,7 +1016,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1062,7 +1062,7 @@ public virtual ArmOperation RemoveDisks(WaitUn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1104,7 +1104,7 @@ public virtual async Task> Repair /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1146,7 +1146,7 @@ public virtual ArmOperation RepairReplication( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1192,7 +1192,7 @@ public virtual async Task> Reprot /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1238,7 +1238,7 @@ public virtual ArmOperation Reprotect(WaitUnti /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1284,7 +1284,7 @@ public virtual async Task> Resolv /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1330,7 +1330,7 @@ public virtual ArmOperation ResolveHealthError /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1376,7 +1376,7 @@ public virtual async Task> Switch /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1422,7 +1422,7 @@ public virtual ArmOperation SwitchProvider(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1468,7 +1468,7 @@ public virtual async Task> TestFa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1514,7 +1514,7 @@ public virtual ArmOperation TestFailover(WaitU /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1560,7 +1560,7 @@ public virtual async Task> TestFa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1606,7 +1606,7 @@ public virtual ArmOperation TestFailoverCleanu /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1652,7 +1652,7 @@ public virtual async Task> Unplan /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1698,7 +1698,7 @@ public virtual ArmOperation UnplannedFailover( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1744,7 +1744,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1790,7 +1790,7 @@ public virtual ArmOperation UpdateAppliance(Wa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1836,7 +1836,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1882,7 +1882,7 @@ public virtual ArmOperation UpdateMobilityServ /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// @@ -1908,7 +1908,7 @@ public virtual AsyncPageable GetTargetComputeSizesByReplicati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.Serialization.cs new file mode 100644 index 000000000000..b57d89280693 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.Serialization.cs @@ -0,0 +1,155 @@ +// 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; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + public partial class ReplicationProtectionClusterData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationProtectionClusterData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ReplicationProtectionClusterData 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(ReplicationProtectionClusterData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationProtectionClusterData(document.RootElement, options); + } + + internal static ReplicationProtectionClusterData DeserializeReplicationProtectionClusterData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReplicationProtectionClusterProperties 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 = ReplicationProtectionClusterProperties.DeserializeReplicationProtectionClusterProperties(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 ReplicationProtectionClusterData( + id, + name, + type, + systemData, + properties, + 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(ReplicationProtectionClusterData)} does not support writing '{options.Format}' format."); + } + } + + ReplicationProtectionClusterData 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationProtectionClusterData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationProtectionClusterData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.cs new file mode 100644 index 000000000000..94950cb12c93 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionClusterData.cs @@ -0,0 +1,75 @@ +// 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.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + /// + /// A class representing the ReplicationProtectionCluster data model. + /// Replication protection Cluster. + /// + public partial class ReplicationProtectionClusterData : 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 ReplicationProtectionClusterData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The custom data. + /// Keeps track of any properties unknown to the library. + internal ReplicationProtectionClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ReplicationProtectionClusterProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The custom data. + public ReplicationProtectionClusterProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentCollection.cs index a07de222bfc1..2ad67ec476a3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -263,7 +263,7 @@ public virtual Response Get(string intentOb /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -295,7 +295,7 @@ public virtual AsyncPageable GetAllAsync(st /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -327,7 +327,7 @@ public virtual Pageable GetAll(string skipT /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task> ExistsAsync(string intentObjectName, C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual Response Exists(string intentObjectName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentResource.cs index c6a9269ab9b9..9e1e27eb4452 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/ReplicationProtectionIntentResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -231,7 +231,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointRestOperations.cs new file mode 100644 index 000000000000..08ae654b8258 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointRestOperations.cs @@ -0,0 +1,166 @@ +// 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.RecoveryServicesSiteRecovery +{ + internal partial class ClusterRecoveryPointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ClusterRecoveryPointRestOperations. + /// 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 ClusterRecoveryPointRestOperations(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 ?? "2025-02-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, string recoveryPointName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, string recoveryPointName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the details of specified recovery point. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The recovery point 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 resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, recoveryPointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ClusterRecoveryPointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ClusterRecoveryPointData.DeserializeClusterRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ClusterRecoveryPointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the details of specified recovery point. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The recovery point 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 resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, recoveryPointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ClusterRecoveryPointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ClusterRecoveryPointData.DeserializeClusterRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ClusterRecoveryPointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointsRestOperations.cs new file mode 100644 index 000000000000..3bf53da5e064 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ClusterRecoveryPointsRestOperations.cs @@ -0,0 +1,253 @@ +// 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.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + internal partial class ClusterRecoveryPointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ClusterRecoveryPointsRestOperations. + /// 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 ClusterRecoveryPointsRestOperations(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 ?? "2025-02-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByReplicationProtectionClusterRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByReplicationProtectionClusterRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The list of cluster recovery points. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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> ListByReplicationProtectionClusterAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateListByReplicationProtectionClusterRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ClusterRecoveryPointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.ClusterRecoveryPointCollection.DeserializeClusterRecoveryPointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The list of cluster recovery points. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response ListByReplicationProtectionCluster(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateListByReplicationProtectionClusterRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ClusterRecoveryPointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.ClusterRecoveryPointCollection.DeserializeClusterRecoveryPointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByReplicationProtectionClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByReplicationProtectionClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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; + } + + /// The list of cluster recovery points. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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> ListByReplicationProtectionClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateListByReplicationProtectionClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ClusterRecoveryPointCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.ClusterRecoveryPointCollection.DeserializeClusterRecoveryPointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The list of cluster recovery points. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response ListByReplicationProtectionClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateListByReplicationProtectionClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ClusterRecoveryPointCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.ClusterRecoveryPointCollection.DeserializeClusterRecoveryPointCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/MigrationRecoveryPointsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/MigrationRecoveryPointsRestOperations.cs index 0dd5a18702ba..8f6a528bf20e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/MigrationRecoveryPointsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/MigrationRecoveryPointsRestOperations.cs @@ -32,7 +32,7 @@ public MigrationRecoveryPointsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/RecoveryPointsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/RecoveryPointsRestOperations.cs index 631ebdd5a4a1..c97f733c01b6 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/RecoveryPointsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/RecoveryPointsRestOperations.cs @@ -32,7 +32,7 @@ public RecoveryPointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAlertSettingsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAlertSettingsRestOperations.cs index fc18283d1efc..b35f2c5694ce 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAlertSettingsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAlertSettingsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationAlertSettingsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAppliancesRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAppliancesRestOperations.cs index 16ed7935486d..5ec58b866882 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAppliancesRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationAppliancesRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationAppliancesRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEligibilityResultsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEligibilityResultsRestOperations.cs index 64f31da277da..59b928dfedaa 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEligibilityResultsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEligibilityResultsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationEligibilityResultsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEventsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEventsRestOperations.cs index 656912d9f9e2..0a1801982f61 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEventsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationEventsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationEventsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationFabricsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationFabricsRestOperations.cs index 7dec574e4f8b..d27fb2e8c3e4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationFabricsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationFabricsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationFabricsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationJobsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationJobsRestOperations.cs index e75f55bf7fdb..ecb855734dd8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationJobsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationJobsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationJobsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationLogicalNetworksRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationLogicalNetworksRestOperations.cs index 5f318749ced6..0d40713a6c61 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationLogicalNetworksRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationLogicalNetworksRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationLogicalNetworksRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationMigrationItemsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationMigrationItemsRestOperations.cs index 64c6e803b26d..0102c0d0cb5a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationMigrationItemsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationMigrationItemsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationMigrationItemsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworkMappingsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworkMappingsRestOperations.cs index 4a578e591eee..177e33d59659 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworkMappingsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworkMappingsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationNetworkMappingsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworksRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworksRestOperations.cs index 21b2aab0efab..d8b97d0fde23 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworksRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationNetworksRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationNetworksRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationPoliciesRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationPoliciesRestOperations.cs index 6a573b45b116..3b7d2af40388 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationPoliciesRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationPoliciesRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationPoliciesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectableItemsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectableItemsRestOperations.cs index 2407671bc395..401ac4efd9c5 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectableItemsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectableItemsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationProtectableItemsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectedItemsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectedItemsRestOperations.cs index 15369897975c..8599c0af0bf7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectedItemsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectedItemsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationProtectedItemsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionClustersRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionClustersRestOperations.cs new file mode 100644 index 000000000000..38c9fa740aa9 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionClustersRestOperations.cs @@ -0,0 +1,1607 @@ +// 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.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + internal partial class ReplicationProtectionClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReplicationProtectionClustersRestOperations. + /// 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 ReplicationProtectionClustersRestOperations(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 ?? "2025-02-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByReplicationProtectionContainersRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByReplicationProtectionContainersRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of ASR replication protected clusters in the protection container. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection 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> ListByReplicationProtectionContainersAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + + using var message = CreateListByReplicationProtectionContainersRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of ASR replication protected clusters in the protection container. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByReplicationProtectionContainers(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + + using var message = CreateListByReplicationProtectionContainersRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of an ASR replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationProtectionClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of an ASR replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster 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 resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationProtectionClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ReplicationProtectionClusterData 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ReplicationProtectionClusterData 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, 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; + } + + /// The operation to create an ASR replication protection cluster item. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Create replication protection cluster Input. + /// 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 resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, 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); + } + } + + /// The operation to create an ASR replication protection cluster item. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Create replication protection cluster Input. + /// 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 resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePurgeRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePurgeRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to purge the replication protection cluster. This operation will force delete the replication protection cluster. Use the remove operation on replication protection cluster to perform a clean disable replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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 PurgeAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreatePurgeRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to purge the replication protection cluster. This operation will force delete the replication protection cluster. Use the remove operation on replication protection cluster to perform a clean disable replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Purge(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreatePurgeRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateApplyRecoveryPointRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ApplyClusterRecoveryPointContent 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/applyRecoveryPoint", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateApplyRecoveryPointRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ApplyClusterRecoveryPointContent content) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/applyRecoveryPoint", false); + 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; + } + + /// Operation to apply a new cluster recovery point on the Protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Apply recovery point input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task ApplyRecoveryPointAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ApplyClusterRecoveryPointContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateApplyRecoveryPointRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, 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); + } + } + + /// Operation to apply a new cluster recovery point on the Protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Apply recovery point input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response ApplyRecoveryPoint(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ApplyClusterRecoveryPointContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateApplyRecoveryPointRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateFailoverCommitRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/failoverCommit", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateFailoverCommitRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/failoverCommit", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Operation to initiate commit failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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 FailoverCommitAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateFailoverCommitRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to initiate commit failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response FailoverCommit(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateFailoverCommitRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetOperationResultsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ResourceIdentifier jobId) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/operationResults/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetOperationResultsRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ResourceIdentifier jobId) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/operationResults/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Track the results of an asynchronous operation on the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// job id to track. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetOperationResultsAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var message = CreateGetOperationResultsRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, jobId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationProtectionClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Track the results of an asynchronous operation on the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// job id to track. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response GetOperationResults(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var message = CreateGetOperationResultsRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, jobId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationProtectionClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRepairReplicationRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/repairReplication", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRepairReplicationRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/repairReplication", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to repair replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection 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 RepairReplicationAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateRepairReplicationRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to repair replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response RepairReplication(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var message = CreateRepairReplicationRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateTestFailoverRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverContent 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/testFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestFailoverRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverContent content) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/testFailover", false); + 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; + } + + /// Operation to initiate a failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Cluster test failover input body. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task TestFailoverAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateTestFailoverRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, 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); + } + } + + /// Operation to initiate a failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Cluster test failover input body. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response TestFailover(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateTestFailoverRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateTestFailoverCleanupRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverCleanupContent 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/testFailoverCleanup", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestFailoverCleanupRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverCleanupContent content) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/testFailoverCleanup", false); + 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; + } + + /// Operation to clean up the test failover of a replication protected cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Test failover cleanup input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task TestFailoverCleanupAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverCleanupContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateTestFailoverCleanupRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, 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); + } + } + + /// Operation to clean up the test failover of a replication protected cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Test failover cleanup input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response TestFailoverCleanup(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterTestFailoverCleanupContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateTestFailoverCleanupRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUnplannedFailoverRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterUnplannedFailoverContent 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/unplannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUnplannedFailoverRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterUnplannedFailoverContent content) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/replicationProtectionClusters/", false); + uri.AppendPath(replicationProtectionClusterName, true); + uri.AppendPath("/unplannedFailover", false); + 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; + } + + /// Operation to initiate a failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Failover input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task UnplannedFailoverAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterUnplannedFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUnplannedFailoverRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, 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); + } + } + + /// Operation to initiate a failover of the replication protection cluster. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Replication protection cluster name. + /// Failover input. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response UnplannedFailover(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ClusterUnplannedFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUnplannedFailoverRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, replicationProtectionClusterName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string skipToken, string filter) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationProtectionClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("skipToken", skipToken, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName, string skipToken, string filter) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationProtectionClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("skipToken", skipToken, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of ASR replication protected clusters in the vault. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, skipToken, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of ASR replication protected clusters in the vault. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, skipToken, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByReplicationProtectionContainersNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByReplicationProtectionContainersNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName) + { + 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 the list of ASR replication protected clusters in the protection container. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection 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> ListByReplicationProtectionContainersNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + + using var message = CreateListByReplicationProtectionContainersNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of ASR replication protected clusters in the protection container. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListByReplicationProtectionContainersNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + + using var message = CreateListByReplicationProtectionContainersNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string skipToken, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string skipToken, string filter) + { + 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 the list of ASR replication protected clusters in the vault. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, skipToken, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of ASR replication protected clusters in the vault. + /// The URL to the next page of results. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// The pagination token. Possible values: "FabricId" or "FabricId_CloudId" or null. + /// OData filter options. + /// 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 resourceName, string skipToken = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, skipToken, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationProtectionClusterCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationProtectionClusterCollection.DeserializeReplicationProtectionClusterCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainerMappingsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainerMappingsRestOperations.cs index 73ee7cc3b292..0caf5193978c 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainerMappingsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainerMappingsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationProtectionContainerMappingsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainersRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainersRestOperations.cs index 498593794ba0..ebad70ce2388 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainersRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionContainersRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationProtectionContainersRestOperations(HttpPipeline pipeline, stri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -569,6 +569,116 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } + internal RequestUriBuilder CreateSwitchClusterProtectionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, SwitchClusterProtectionContent 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/switchClusterProtection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSwitchClusterProtectionRequest(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, SwitchClusterProtectionContent content) + { + 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.RecoveryServices/vaults/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/replicationProtectionContainers/", false); + uri.AppendPath(protectionContainerName, true); + uri.AppendPath("/switchClusterProtection", false); + 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; + } + + /// Operation to switch protection from one container to another. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Switch protection input. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task SwitchClusterProtectionAsync(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, SwitchClusterProtectionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateSwitchClusterProtectionRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, 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); + } + } + + /// Operation to switch protection from one container to another. + /// The subscription Id. + /// The name of the resource group where the recovery services vault is present. + /// The name of the recovery services vault. + /// Fabric name. + /// Protection container name. + /// Switch protection input. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response SwitchClusterProtection(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, SwitchClusterProtectionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(protectionContainerName, nameof(protectionContainerName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateSwitchClusterProtectionRequest(subscriptionId, resourceGroupName, resourceName, fabricName, protectionContainerName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateSwitchProtectionRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, SwitchProtectionContent content) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionIntentsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionIntentsRestOperations.cs index 93b3e31a16ae..52985e096667 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionIntentsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationProtectionIntentsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationProtectionIntentsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryPlansRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryPlansRestOperations.cs index 7e5abe1ab784..a3835e8c552b 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryPlansRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryPlansRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationRecoveryPlansRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -855,7 +855,7 @@ internal HttpMessage CreateReprotectRequest(string subscriptionId, string resour return message; } - /// The operation to reprotect(reverse replicate) a recovery plan. + /// The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and no longer works. /// The subscription Id. /// The name of the resource group where the recovery services vault is present. /// The name of the recovery services vault. @@ -882,7 +882,7 @@ public async Task ReprotectAsync(string subscriptionId, string resourc } } - /// The operation to reprotect(reverse replicate) a recovery plan. + /// The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and no longer works. /// The subscription Id. /// The name of the resource group where the recovery services vault is present. /// The name of the recovery services vault. diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryServicesProvidersRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryServicesProvidersRestOperations.cs index cd11badf2907..655e3865cb61 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryServicesProvidersRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationRecoveryServicesProvidersRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationRecoveryServicesProvidersRestOperations(HttpPipeline pipeline, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationMappingsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationMappingsRestOperations.cs index dca871f01dd6..a8327e7ad1f6 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationMappingsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationMappingsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationStorageClassificationMappingsRestOperations(HttpPipeline pipel { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationsRestOperations.cs index 313e573f62b0..8ef06f065471 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationStorageClassificationsRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationStorageClassificationsRestOperations(HttpPipeline pipeline, st { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultHealthRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultHealthRestOperations.cs index 2177443a5ee3..0ca8cf4cea5d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultHealthRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultHealthRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationVaultHealthRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultSettingRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultSettingRestOperations.cs index 9393f8e4bf58..2473f946875e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultSettingRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationVaultSettingRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationVaultSettingRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationvCentersRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationvCentersRestOperations.cs index 940ec0360a6f..49848e3469ac 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationvCentersRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/ReplicationvCentersRestOperations.cs @@ -32,7 +32,7 @@ public ReplicationvCentersRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/SupportedOperatingSystemsRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/SupportedOperatingSystemsRestOperations.cs index 20bb4a45cb16..8b64bd604106 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/SupportedOperatingSystemsRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/SupportedOperatingSystemsRestOperations.cs @@ -32,7 +32,7 @@ public SupportedOperatingSystemsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/TargetComputeSizesRestOperations.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/TargetComputeSizesRestOperations.cs index 4866a7a228f6..6e1c2827e45e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/TargetComputeSizesRestOperations.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/RestOperations/TargetComputeSizesRestOperations.cs @@ -32,7 +32,7 @@ public TargetComputeSizesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-08-01"; + _apiVersion = apiVersion ?? "2025-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertCollection.cs index 0e2e76ac711c..ae5933ab3d98 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetAsync(string a /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -263,7 +263,7 @@ public virtual Response Get(string alertSettingName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -293,7 +293,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string alertSettingName, C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string alertSettingName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertResource.cs index cdd5ccb8bd5d..962d1a1adf6f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryAlertResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -231,7 +231,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventCollection.cs index 34273009b257..429e450c2ce7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventCollection.cs @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> GetAsync(string e /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -160,7 +160,7 @@ public virtual Response Get(string eventName, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual AsyncPageable GetAllAsync(string filte /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual Pageable GetAll(string filter = null, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual async Task> ExistsAsync(string eventName, Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Response Exists(string eventName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventResource.cs index 0d0db38c872e..ec5d15d4e879 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryEventResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricCollection.cs index ced6ab1c0a8c..6388d84ca165 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual Response Get(string fabricName, strin /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string fabricName, string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string fabricName, string filter = null, Ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -455,7 +455,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs index 67b2f33f3e96..336785460c37 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryFabricResource.cs @@ -110,7 +110,7 @@ public virtual SiteRecoveryLogicalNetworkCollection GetSiteRecoveryLogicalNetwor /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetSiteR /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual SiteRecoveryNetworkCollection GetSiteRecoveryNetworks() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetSiteRecovery /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -248,7 +248,7 @@ public virtual SiteRecoveryProtectionContainerCollection GetSiteRecoveryProtecti /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual SiteRecoveryServicesProviderCollection GetSiteRecoveryServicesPro /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -348,7 +348,7 @@ public virtual async Task> GetSit /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual StorageClassificationCollection GetStorageClassifications() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> GetStorageCla /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -455,7 +455,7 @@ public virtual SiteRecoveryVCenterCollection GetSiteRecoveryVCenters() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -486,7 +486,7 @@ public virtual async Task> GetSiteRecovery /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -517,7 +517,7 @@ public virtual Response GetSiteRecoveryVCenter(stri /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -558,7 +558,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response Get(string filter = null, Ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -645,7 +645,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -691,7 +691,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> CheckConsist /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -775,7 +775,7 @@ public virtual ArmOperation CheckConsistency(WaitUnt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -817,7 +817,7 @@ public virtual async Task MigrateToAadAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -859,7 +859,7 @@ public virtual ArmOperation MigrateToAad(WaitUntil waitUntil, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -905,7 +905,7 @@ public virtual async Task> ReassociateG /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -951,7 +951,7 @@ public virtual ArmOperation ReassociateGateway(WaitU /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -993,7 +993,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1035,7 +1035,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1081,7 +1081,7 @@ public virtual async Task> RenewCertifi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1127,7 +1127,7 @@ public virtual ArmOperation RenewCertificate(WaitUnt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -1169,7 +1169,7 @@ public virtual async Task RemoveInfraAsync(WaitUntil waitUntil, Ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobCollection.cs index 3fde824f5f50..ac02c1f4ff3a 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobCollection.cs @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> GetAsync(string job /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -160,7 +160,7 @@ public virtual Response Get(string jobName, Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual AsyncPageable GetAllAsync(string filter /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual Pageable GetAll(string filter = null, Ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual async Task> ExistsAsync(string jobName, Cancellati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Response Exists(string jobName, CancellationToken cancellat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobResource.cs index adfdb6f00a5c..7349f0ccc731 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryJobResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task> CancelAsync(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Cancel(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -309,7 +309,7 @@ public virtual async Task> RestartAsync(Wa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -397,7 +397,7 @@ public virtual async Task> ResumeAsync(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation Resume(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -489,7 +489,7 @@ public virtual async Task> ExportAsync(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkCollection.cs index ee0ef8069288..9cb13b8618a3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string logicalNe /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string logicalNetworkName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string logicalNetworkName, CancellationToke /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkResource.cs index 736a05e99da1..431d1ece8cca 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryLogicalNetworkResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemCollection.cs index 50851b72ada4..2ed062d50f1f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string migrationI /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(stri /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(string skipTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string migrationItemName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string migrationItemName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs index f8ca034b2dd8..2b12c78b7f21 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryMigrationItemResource.cs @@ -111,7 +111,7 @@ public virtual MigrationRecoveryPointCollection GetMigrationRecoveryPoints() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetMigration /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual Response GetMigrationRecoveryPoin /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -339,7 +339,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string deleteOption = nu /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -385,7 +385,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -431,7 +431,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -477,7 +477,7 @@ public virtual async Task> Migra /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -523,7 +523,7 @@ public virtual ArmOperation Migrate(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -569,7 +569,7 @@ public virtual async Task> Pause /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -615,7 +615,7 @@ public virtual ArmOperation PauseReplication( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -661,7 +661,7 @@ public virtual async Task> Resum /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -707,7 +707,7 @@ public virtual ArmOperation ResumeReplication /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -753,7 +753,7 @@ public virtual async Task> Resyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -799,7 +799,7 @@ public virtual ArmOperation Resync(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -845,7 +845,7 @@ public virtual async Task> TestM /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -891,7 +891,7 @@ public virtual ArmOperation TestMigrate(WaitU /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -937,7 +937,7 @@ public virtual async Task> TestM /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkCollection.cs index aacb71305634..f56bd8c7593e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string networkName, Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string networkName, Cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string networkName, CancellationToken cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingCollection.cs index 59af134dd56b..c39802377bd0 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string networkMa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string networkMappingName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string networkMappingName, CancellationToke /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingResource.cs index 45ae383c8dfa..b3ad547aca60 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkMappingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs index 342b61f90cfb..74c8bc63e416 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryNetworkResource.cs @@ -109,7 +109,7 @@ public virtual SiteRecoveryNetworkMappingCollection GetSiteRecoveryNetworkMappin /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetSiteR /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -171,7 +171,7 @@ public virtual Response GetSiteRecoveryNetwo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointCollection.cs index 108082defac0..354187c7be42 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string recoveryPointName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string recoveryPointName, /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string recoveryPointName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointResource.cs index 4f399ddca0e7..14fbcbc98a3f 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPointResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyCollection.cs index d858571bd188..b6d74767e6a4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string policyName, Cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string policyName, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string policyName, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyResource.cs index 0f96c4c7a72f..97cc297ab974 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryPolicyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemCollection.cs index e6a4f7fe4c86..06b188957849 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string protecta /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual AsyncPageable GetAllAsync(st /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -220,7 +220,7 @@ public virtual Pageable GetAll(string filte /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -263,7 +263,7 @@ public virtual async Task> ExistsAsync(string protectableItemName /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -306,7 +306,7 @@ public virtual Response Exists(string protectableItemName, CancellationTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemResource.cs index b6f0310a8bab..350338fa4c97 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectableItemResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerCollection.cs index 8b300da2f8da..495e9fbbd139 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string prot /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string protectionContainer /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string protectionContainerName, Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs index 49f4e4d996fb..16dac85a4be2 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryProtectionContainerResource.cs @@ -110,7 +110,7 @@ public virtual SiteRecoveryMigrationItemCollection GetSiteRecoveryMigrationItems /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetSiteRe /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual SiteRecoveryProtectableItemCollection GetSiteRecoveryProtectableI /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetSite /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -248,7 +248,7 @@ public virtual ReplicationProtectedItemCollection GetReplicationProtectedItems() /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task> GetReplica /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -297,6 +297,75 @@ public virtual Response GetReplicationProtecte return GetReplicationProtectedItems().Get(replicatedProtectedItemName, cancellationToken); } + /// Gets a collection of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResources in the SiteRecoveryProtectionContainer. + /// An object representing collection of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResources and their operations over a VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource. + public virtual VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters() + { + return GetCachedClient(client => new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection(client, Id)); + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterAsync(string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + return await GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters().GetAsync(replicationProtectionClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster(string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + return GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters().Get(replicationProtectionClusterName, cancellationToken); + } + /// Gets a collection of ProtectionContainerMappingResources in the SiteRecoveryProtectionContainer. /// An object representing collection of ProtectionContainerMappingResources and their operations over a ProtectionContainerMappingResource. public virtual ProtectionContainerMappingCollection GetProtectionContainerMappings() @@ -317,7 +386,7 @@ public virtual ProtectionContainerMappingCollection GetProtectionContainerMappin /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -348,7 +417,7 @@ public virtual async Task> GetProte /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -379,7 +448,7 @@ public virtual Response GetProtectionContain /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -419,7 +488,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -459,7 +528,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -505,7 +574,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -551,7 +620,7 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -597,7 +666,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -643,7 +712,7 @@ public virtual ArmOperation DiscoverPro /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -685,7 +754,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -714,6 +783,98 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } } + /// + /// Operation to switch protection from one container to another. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchClusterProtection + /// + /// + /// Operation Id + /// ReplicationProtectionContainers_SwitchClusterProtection + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Switch protection input. + /// The cancellation token to use. + /// is null. + public virtual async Task> SwitchClusterProtectionAsync(WaitUntil waitUntil, SwitchClusterProtectionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _siteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics.CreateScope("SiteRecoveryProtectionContainerResource.SwitchClusterProtection"); + scope.Start(); + try + { + var response = await _siteRecoveryProtectionContainerReplicationProtectionContainersRestClient.SwitchClusterProtectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new SiteRecoveryProtectionContainerOperationSource(Client), _siteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, _siteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateSwitchClusterProtectionRequest(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; + } + } + + /// + /// Operation to switch protection from one container to another. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchClusterProtection + /// + /// + /// Operation Id + /// ReplicationProtectionContainers_SwitchClusterProtection + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Switch protection input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation SwitchClusterProtection(WaitUntil waitUntil, SwitchClusterProtectionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _siteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics.CreateScope("SiteRecoveryProtectionContainerResource.SwitchClusterProtection"); + scope.Start(); + try + { + var response = _siteRecoveryProtectionContainerReplicationProtectionContainersRestClient.SwitchClusterProtection(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new SiteRecoveryProtectionContainerOperationSource(Client), _siteRecoveryProtectionContainerReplicationProtectionContainersClientDiagnostics, Pipeline, _siteRecoveryProtectionContainerReplicationProtectionContainersRestClient.CreateSwitchClusterProtectionRequest(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; + } + } + /// /// Operation to switch protection from one container to another or one replication provider to another. /// @@ -727,7 +888,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -773,7 +934,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanCollection.cs index f628a66d1690..370b817725f3 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string recoveryPla /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string recoveryPlanName, C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string recoveryPlanName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanResource.cs index f695d2200f78..85955cb07cad 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryRecoveryPlanResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Failov /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation FailoverCancel(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual async Task> Failov /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -527,7 +527,7 @@ public virtual ArmOperation FailoverCommit(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -573,7 +573,7 @@ public virtual async Task> Planne /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -607,7 +607,7 @@ public virtual ArmOperation PlannedFailover(Wa } /// - /// The operation to reprotect(reverse replicate) a recovery plan. + /// The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and no longer works. /// /// /// Request Path @@ -619,7 +619,7 @@ public virtual ArmOperation PlannedFailover(Wa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> Reprot } /// - /// The operation to reprotect(reverse replicate) a recovery plan. + /// The operation to reprotect(reverse replicate) a recovery plan. This api is for deprecated scenarios and no longer works. /// /// /// Request Path @@ -661,7 +661,7 @@ public virtual async Task> Reprot /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -703,7 +703,7 @@ public virtual ArmOperation Reprotect(WaitUnti /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -749,7 +749,7 @@ public virtual async Task> TestFa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -795,7 +795,7 @@ public virtual ArmOperation TestFailover(WaitU /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -841,7 +841,7 @@ public virtual async Task> TestFa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -887,7 +887,7 @@ public virtual ArmOperation TestFailoverCleanu /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -933,7 +933,7 @@ public virtual async Task> Unplan /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderCollection.cs index cc38c0565ca7..f394ff9ed760 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string provide /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string providerName, Cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string providerName, CancellationToken canc /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderResource.cs index dc7ac4ffd856..36fa491c6dff 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryServicesProviderResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation RefreshProvide /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterCollection.cs index a1360b109d93..da6777fcabf8 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string vCenterName, Can /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string vCenterName, Cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string vCenterName, CancellationToken cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterResource.cs index 42f4dcc4f122..3ca0f6701f8d 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVCenterResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingCollection.cs index ffcfbfaaa9e3..d8b5ff8fdc81 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingCollection.cs @@ -71,7 +71,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string vaultSettin /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string vaultSettingName, C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string vaultSettingName, CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingResource.cs index 3b388571344a..6e789148b509 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/SiteRecoveryVaultSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationCollection.cs index 4f00e881ce24..5d07dff923b7 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string storageClassif /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string storageClassificati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string storageClassificationName, Cancellat /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingCollection.cs index 216b385b4ed3..5920995652e4 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingCollection.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storage /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string storageClassificati /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string storageClassificationMappingName, Ca /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingResource.cs index 110ed77e2b4c..98b64c02ac79 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationMappingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs index 880c69ed60a8..2dcd32b26ba0 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/StorageClassificationResource.cs @@ -109,7 +109,7 @@ public virtual StorageClassificationMappingCollection GetStorageClassificationMa /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetSto /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -171,7 +171,7 @@ public virtual Response GetStorageClassifi /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2023-08-01 + /// 2025-02-01 /// /// /// Resource diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs new file mode 100644 index 000000000000..8beb71bc7094 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.cs @@ -0,0 +1,493 @@ +// 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.RecoveryServicesSiteRecovery +{ + /// + /// 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 GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusters method from an instance of . + /// + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics; + private readonly ReplicationProtectionClustersRestOperations _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient; + + /// Initializes a new instance of the class for mocking. + protected VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection() + { + } + + /// 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType, out string vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersApiVersion); + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient = new ReplicationProtectionClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SiteRecoveryProtectionContainerResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SiteRecoveryProtectionContainerResource.ResourceType), nameof(id)); + } + + /// + /// The operation to create an ASR replication protection cluster item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Create + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Replication protection cluster name. + /// Create replication protection cluster Input. + /// 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 replicationProtectionClusterName, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create an ASR replication protection cluster item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Create + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Replication protection cluster name. + /// Create replication protection cluster Input. + /// 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 replicationProtectionClusterName, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, data, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster 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 replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.Get"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.Get"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of ASR replication protected clusters in the protection container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_ListByReplicationProtectionContainers + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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) => _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateListByReplicationProtectionContainersRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateListByReplicationProtectionContainersNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(e)), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, "VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of ASR replication protected clusters in the protection container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_ListByReplicationProtectionContainers + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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) => _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateListByReplicationProtectionContainersRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateListByReplicationProtectionContainersNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, ReplicationProtectionClusterData.DeserializeReplicationProtectionClusterData(e)), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, "VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster 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 replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.Exists"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster 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 replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Replication protection cluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string replicationProtectionClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationProtectionClusterName, nameof(replicationProtectionClusterName)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, replicationProtectionClusterName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(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/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs new file mode 100644 index 000000000000..9131dd6df540 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.cs @@ -0,0 +1,311 @@ +// 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.RecoveryServicesSiteRecovery +{ + /// + /// 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 GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults method from an instance of . + /// + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection : ArmCollection + { + private readonly ClientDiagnostics _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics; + private readonly ReplicationProtectionClustersRestOperations _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient; + + /// Initializes a new instance of the class for mocking. + protected VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection() + { + } + + /// 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.ResourceType, out string vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersApiVersion); + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient = new ReplicationProtectionClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ResourceType), nameof(id)); + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetAsync(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.Get"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResultsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual Response Get(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.Get"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResults(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(Client, response.Value), 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual async Task> ExistsAsync(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.Exists"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResultsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual Response Exists(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.Exists"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResults(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, 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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetIfExistsAsync(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResultsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(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.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + public virtual NullableResponse GetIfExists(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(jobId, nameof(jobId)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResults(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, jobId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.Serialization.cs new file mode 100644 index 000000000000..011dfad53966 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.RecoveryServicesSiteRecovery +{ + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ReplicationProtectionClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ReplicationProtectionClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs new file mode 100644 index 000000000000..5ba968b086b7 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.cs @@ -0,0 +1,174 @@ +// 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.RecoveryServicesSiteRecovery +{ + /// + /// A Class representing a VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResult 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 GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource method. + /// Otherwise you can get one from its parent resource using the GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResult method. + /// + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The fabricName. + /// The protectionContainerName. + /// The replicationProtectionClusterName. + /// The jobId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName, ResourceIdentifier jobId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics; + private readonly ReplicationProtectionClustersRestOperations _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient; + private readonly ReplicationProtectionClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionClusters/operationResults"; + + /// Initializes a new instance of the class for mocking. + protected VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(ArmClient client, ReplicationProtectionClusterData 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersApiVersion); + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient = new ReplicationProtectionClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersApiVersion); +#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 ReplicationProtectionClusterData 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)); + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.Get"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResultsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, new ResourceIdentifier(Id.Name), cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource.Get"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultReplicationProtectionClustersRestClient.GetOperationResults(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Parent.Name, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, new ResourceIdentifier(Id.Name), cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Serialization.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Serialization.cs new file mode 100644 index 000000000000..3ba634778a5e --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Serialization.cs @@ -0,0 +1,26 @@ +// 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.RecoveryServicesSiteRecovery +{ + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ReplicationProtectionClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ReplicationProtectionClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs new file mode 100644 index 000000000000..ea9ef9b5dad0 --- /dev/null +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/Generated/VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.cs @@ -0,0 +1,1022 @@ +// 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.RecoveryServicesSiteRecovery.Models; + +namespace Azure.ResourceManager.RecoveryServicesSiteRecovery +{ + /// + /// A Class representing a VaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster 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 GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource method. + /// Otherwise you can get one from its parent resource using the GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster method. + /// + public partial class VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The fabricName. + /// The protectionContainerName. + /// The replicationProtectionClusterName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string fabricName, string protectionContainerName, string replicationProtectionClusterName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics; + private readonly ReplicationProtectionClustersRestOperations _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient; + private readonly ReplicationProtectionClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionClusters"; + + /// Initializes a new instance of the class for mocking. + protected VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(ArmClient client, ReplicationProtectionClusterData 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesSiteRecovery", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersApiVersion); + _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient = new ReplicationProtectionClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersApiVersion); +#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 ReplicationProtectionClusterData 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResources in the VaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster. + /// An object representing collection of VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResources and their operations over a VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultResource. + public virtual VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults() + { + return GetCachedClient(client => new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultCollection(client, Id)); + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResultAsync(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + return await GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults().GetAsync(jobId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Track the results of an asynchronous operation on the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/operationResults/{jobId} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_GetOperationResults + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// job id to track. + /// The cancellation token to use. + /// is null. + [ForwardsClientCalls] + public virtual Response GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResult(ResourceIdentifier jobId, CancellationToken cancellationToken = default) + { + return GetVaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationResults().Get(jobId, cancellationToken); + } + + /// Gets a collection of ClusterRecoveryPointResources in the VaultReplicationFabricReplicationProtectionContainerReplicationProtectionCluster. + /// An object representing collection of ClusterRecoveryPointResources and their operations over a ClusterRecoveryPointResource. + public virtual ClusterRecoveryPointCollection GetClusterRecoveryPoints() + { + return GetCachedClient(client => new ClusterRecoveryPointCollection(client, Id)); + } + + /// + /// Get the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetClusterRecoveryPointAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + return await GetClusterRecoveryPoints().GetAsync(recoveryPointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the details of specified recovery point. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// ClusterRecoveryPoint_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetClusterRecoveryPoint(string recoveryPointName, CancellationToken cancellationToken = default) + { + return GetClusterRecoveryPoints().Get(recoveryPointName, cancellationToken); + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Get"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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 VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of an ASR replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Get + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Get"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to purge the replication protection cluster. This operation will force delete the replication protection cluster. Use the remove operation on replication protection cluster to perform a clean disable replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Purge + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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 = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Delete"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.PurgeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(_vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreatePurgeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// The operation to purge the replication protection cluster. This operation will force delete the replication protection cluster. Use the remove operation on replication protection cluster to perform a clean disable replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Purge + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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 = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Delete"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Purge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(_vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreatePurgeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// The operation to create an ASR replication protection cluster item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Create + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Create replication protection cluster Input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Update"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.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; + } + } + + /// + /// The operation to create an ASR replication protection cluster item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName} + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_Create + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Create replication protection cluster Input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ReplicationProtectionClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.Update"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to apply a new cluster recovery point on the Protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/applyRecoveryPoint + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_ApplyRecoveryPoint + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Apply recovery point input. + /// The cancellation token to use. + /// is null. + public virtual async Task> ApplyRecoveryPointAsync(WaitUntil waitUntil, ApplyClusterRecoveryPointContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ApplyRecoveryPoint"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.ApplyRecoveryPointAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateApplyRecoveryPointRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to apply a new cluster recovery point on the Protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/applyRecoveryPoint + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_ApplyRecoveryPoint + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Apply recovery point input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ApplyRecoveryPoint(WaitUntil waitUntil, ApplyClusterRecoveryPointContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.ApplyRecoveryPoint"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.ApplyRecoveryPoint(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateApplyRecoveryPointRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to initiate commit failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/failoverCommit + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_FailoverCommit + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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> FailoverCommitAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.FailoverCommit"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.FailoverCommitAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateFailoverCommitRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to initiate commit failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/failoverCommit + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_FailoverCommit + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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 FailoverCommit(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.FailoverCommit"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.FailoverCommit(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateFailoverCommitRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to repair replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/repairReplication + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_RepairReplication + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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> RepairReplicationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.RepairReplication"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.RepairReplicationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateRepairReplicationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to repair replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/repairReplication + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_RepairReplication + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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 RepairReplication(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.RepairReplication"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.RepairReplication(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateRepairReplicationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to initiate a failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailover + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_TestFailover + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Cluster test failover input body. + /// The cancellation token to use. + /// is null. + public virtual async Task> TestFailoverAsync(WaitUntil waitUntil, ClusterTestFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.TestFailover"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.TestFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateTestFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to initiate a failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailover + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_TestFailover + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Cluster test failover input body. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation TestFailover(WaitUntil waitUntil, ClusterTestFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.TestFailover"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.TestFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateTestFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to clean up the test failover of a replication protected cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailoverCleanup + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_TestFailoverCleanup + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Test failover cleanup input. + /// The cancellation token to use. + /// is null. + public virtual async Task> TestFailoverCleanupAsync(WaitUntil waitUntil, ClusterTestFailoverCleanupContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.TestFailoverCleanup"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.TestFailoverCleanupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateTestFailoverCleanupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to clean up the test failover of a replication protected cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/testFailoverCleanup + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_TestFailoverCleanup + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Test failover cleanup input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation TestFailoverCleanup(WaitUntil waitUntil, ClusterTestFailoverCleanupContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.TestFailoverCleanup"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.TestFailoverCleanup(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateTestFailoverCleanupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to initiate a failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/unplannedFailover + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_UnplannedFailover + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Failover input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UnplannedFailoverAsync(WaitUntil waitUntil, ClusterUnplannedFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.UnplannedFailover"); + scope.Start(); + try + { + var response = await _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.UnplannedFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateUnplannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + + /// + /// Operation to initiate a failover of the replication protection cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionClusters/{replicationProtectionClusterName}/unplannedFailover + /// + /// + /// Operation Id + /// ReplicationProtectionClusters_UnplannedFailover + /// + /// + /// Default Api Version + /// 2025-02-01 + /// + /// + /// 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. + /// Failover input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation UnplannedFailover(WaitUntil waitUntil, ClusterUnplannedFailoverContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics.CreateScope("VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterResource.UnplannedFailover"); + scope.Start(); + try + { + var response = _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.UnplannedFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new RecoveryServicesSiteRecoveryArmOperation(new VaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterOperationSource(Client), _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersClientDiagnostics, Pipeline, _vaultReplicationFabricReplicationProtectionContainerReplicationProtectionClusterReplicationProtectionClustersRestClient.CreateUnplannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, 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; + } + } + } +} diff --git a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/autorest.md b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/autorest.md index 2d3e84cc78f3..8125ae8d387e 100644 --- a/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/autorest.md +++ b/sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: RecoveryServicesSiteRecovery namespace: Azure.ResourceManager.RecoveryServicesSiteRecovery -require: https://github.com/Azure/azure-rest-api-specs/blob/39608b2c1c7b7dc06cb99abb9d733665cfce9a75/specification/recoveryservicessiterecovery/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicessiterecovery/resource-manager/readme.md #tag: package-2023-08 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/