From 7233cda63323481ce41585335078eba4b99ef959 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Sep 2023 21:23:07 +0000 Subject: [PATCH] CodeGen from PR 24974 in Azure/azure-rest-api-specs Merge c6548659fc78961bf6d77bd34a1e5630fb78dca7 into baa82396a21dcc1c79a6aeea185589749515012d --- ...anager.Recoveryservicesdatareplication.sln | 65 + .../CHANGELOG.md | 17 + .../Directory.Build.props | 6 + .../README.md | 80 + ...yservicesdatareplication.netstandard2.0.cs | 1427 +++++++++++++++++ .../assets.json | 6 + ...veryservicesdatareplication.Samples.csproj | 10 + .../samples/autorest.tests.md | 13 + ...ger.Recoveryservicesdatareplication.csproj | 8 + ...veryservicesdatareplicationModelFactory.cs | 887 ++++++++++ .../src/Generated/DraModelCollection.cs | 341 ++++ .../src/Generated/DraModelData.cs | 45 + .../src/Generated/DraModelResource.cs | 372 +++++ .../EmailConfigurationModelCollection.cs | 341 ++++ .../Generated/EmailConfigurationModelData.cs | 45 + .../EmailConfigurationModelResource.cs | 229 +++ .../src/Generated/EventModelCollection.cs | 263 +++ .../src/Generated/EventModelData.cs | 45 + .../src/Generated/EventModelResource.cs | 153 ++ ...coveryservicesdatareplicationExtensions.cs | 539 +++++++ .../ResourceGroupResourceExtensionClient.cs | 124 ++ .../SubscriptionResourceExtensionClient.cs | 211 +++ .../src/Generated/FabricModelCollection.cs | 344 ++++ .../src/Generated/FabricModelData.cs | 49 + .../src/Generated/FabricModelResource.cs | 737 +++++++++ .../DraModelOperationSource.cs | 40 + .../FabricModelOperationSource.cs | 40 + .../PlannedFailoverModelOperationSource.cs | 31 + .../PolicyModelOperationSource.cs | 40 + .../ProtectedItemModelOperationSource.cs | 40 + ...veryservicesdatareplicationArmOperation.cs | 70 + ...yservicesdatareplicationArmOperationOfT.cs | 76 + ...eplicationExtensionModelOperationSource.cs | 40 + .../VaultModelOperationSource.cs | 40 + ...StackHCIClusterProperties.Serialization.cs | 76 + .../Models/AzStackHCIClusterProperties.cs | 59 + ...bricModelCustomProperties.Serialization.cs | 104 ++ .../AzStackHCIFabricModelCustomProperties.cs | 71 + ...heckNameAvailabilityModel.Serialization.cs | 31 + .../Models/CheckNameAvailabilityModel.cs | 23 + ...AvailabilityResponseModel.Serialization.cs | 49 + .../CheckNameAvailabilityResponseModel.cs | 36 + .../DeploymentPreflightModel.Serialization.cs | 59 + .../Models/DeploymentPreflightModel.cs | 32 + ...ploymentPreflightResource.Serialization.cs | 81 + .../Models/DeploymentPreflightResource.cs | 42 + .../DraModelCollection.Serialization.cs | 50 + .../Generated/Models/DraModelCollection.cs | 37 + .../DraModelCustomProperties.Serialization.cs | 39 + .../Models/DraModelCustomProperties.cs | 32 + .../Models/DraModelData.Serialization.cs | 71 + .../DraModelProperties.Serialization.cs | 132 ++ .../Generated/Models/DraModelProperties.cs | 102 ++ ...figurationModelCollection.Serialization.cs | 50 + .../EmailConfigurationModelCollection.cs | 37 + ...ailConfigurationModelData.Serialization.cs | 71 + ...figurationModelProperties.Serialization.cs | 78 + .../EmailConfigurationModelProperties.cs | 42 + .../Models/ErrorModel.Serialization.cs | 74 + .../src/Generated/Models/ErrorModel.cs | 54 + .../EventModelCollection.Serialization.cs | 50 + .../Generated/Models/EventModelCollection.cs | 37 + ...ventModelCustomProperties.Serialization.cs | 30 + .../Models/EventModelCustomProperties.cs | 32 + .../Models/EventModelData.Serialization.cs | 63 + .../EventModelProperties.Serialization.cs | 102 ++ .../Generated/Models/EventModelProperties.cs | 86 + .../FabricModelCollection.Serialization.cs | 50 + .../Generated/Models/FabricModelCollection.cs | 37 + ...bricModelCustomProperties.Serialization.cs | 41 + .../Models/FabricModelCustomProperties.cs | 32 + .../Models/FabricModelData.Serialization.cs | 106 ++ .../Models/FabricModelPatch.Serialization.cs | 37 + .../src/Generated/Models/FabricModelPatch.cs | 28 + .../FabricModelProperties.Serialization.cs | 89 + .../Generated/Models/FabricModelProperties.cs | 70 + ...erProtectedItemProperties.Serialization.cs | 74 + .../Models/FailoverProtectedItemProperties.cs | 54 + ...flowModelCustomProperties.Serialization.cs | 64 + .../FailoverWorkflowModelCustomProperties.cs | 36 + .../Models/HealthErrorModel.Serialization.cs | 139 ++ .../src/Generated/Models/HealthErrorModel.cs | 94 ++ .../src/Generated/Models/HealthStatus.cs | 54 + ...bricModelCustomProperties.Serialization.cs | 80 + ...yperVMigrateFabricModelCustomProperties.cs | 58 + ...perVToAzStackHCIDiskInput.Serialization.cs | 91 ++ .../Models/HyperVToAzStackHCIDiskInput.cs | 69 + ...ventModelCustomProperties.Serialization.cs | 63 + ...VToAzStackHCIEventModelCustomProperties.cs | 51 + ...yperVToAzStackHCINicInput.Serialization.cs | 71 + .../Models/HyperVToAzStackHCINicInput.cs | 60 + ...overModelCustomProperties.Serialization.cs | 49 + ...HCIPlannedFailoverModelCustomProperties.cs | 33 + ...licyModelCustomProperties.Serialization.cs | 65 + ...ToAzStackHCIPolicyModelCustomProperties.cs | 54 + ...CIProtectedDiskProperties.Serialization.cs | 105 ++ ...perVToAzStackHCIProtectedDiskProperties.cs | 74 + ...ItemModelCustomProperties.Serialization.cs | 418 +++++ ...ckHCIProtectedItemModelCustomProperties.cs | 240 +++ ...HCIProtectedNicProperties.Serialization.cs | 67 + ...yperVToAzStackHCIProtectedNicProperties.cs | 48 + ...ointModelCustomProperties.Serialization.cs | 49 + ...ckHCIRecoveryPointModelCustomProperties.cs | 35 + ...sionModelCustomProperties.Serialization.cs | 164 ++ ...plicationExtensionModelCustomProperties.cs | 102 ++ .../Models/IdentityModel.Serialization.cs | 74 + .../src/Generated/Models/IdentityModel.cs | 54 + .../InnerHealthErrorModel.Serialization.cs | 102 ++ .../Generated/Models/InnerHealthErrorModel.cs | 70 + .../Models/OperationStatus.Serialization.cs | 57 + .../src/Generated/Models/OperationStatus.cs | 50 + .../PlannedFailoverModel.Serialization.cs | 41 + .../Generated/Models/PlannedFailoverModel.cs | 39 + ...overModelCustomProperties.Serialization.cs | 40 + .../PlannedFailoverModelCustomProperties.cs | 32 + ...edFailoverModelProperties.Serialization.cs | 41 + .../Models/PlannedFailoverModelProperties.cs | 37 + .../PolicyModelCollection.Serialization.cs | 50 + .../Generated/Models/PolicyModelCollection.cs | 37 + ...licyModelCustomProperties.Serialization.cs | 40 + .../Models/PolicyModelCustomProperties.cs | 32 + .../Models/PolicyModelData.Serialization.cs | 71 + .../PolicyModelProperties.Serialization.cs | 51 + .../Generated/Models/PolicyModelProperties.cs | 52 + .../Models/ProtectedItemActiveLocation.cs | 51 + ...edItemDynamicMemoryConfig.Serialization.cs | 57 + .../ProtectedItemDynamicMemoryConfig.cs | 31 + ...rotectedItemJobProperties.Serialization.cs | 78 + .../Models/ProtectedItemJobProperties.cs | 54 + ...tectedItemModelCollection.Serialization.cs | 50 + .../Models/ProtectedItemModelCollection.cs | 37 + ...ItemModelCustomProperties.Serialization.cs | 40 + .../ProtectedItemModelCustomProperties.cs | 32 + .../ProtectedItemModelData.Serialization.cs | 71 + ...tectedItemModelProperties.Serialization.cs | 285 ++++ .../Models/ProtectedItemModelProperties.cs | 169 ++ ...ModelPropertiesCurrentJob.Serialization.cs | 78 + .../ProtectedItemModelPropertiesCurrentJob.cs | 32 + ...FailedEnableProtectionJob.Serialization.cs | 78 + ...PropertiesLastFailedEnableProtectionJob.cs | 32 + ...tFailedPlannedFailoverJob.Serialization.cs | 78 + ...lPropertiesLastFailedPlannedFailoverJob.cs | 32 + ...ertiesLastTestFailoverJob.Serialization.cs | 78 + ...dItemModelPropertiesLastTestFailoverJob.cs | 32 + .../src/Generated/Models/ProtectionState.cs | 201 +++ .../src/Generated/Models/ProvisioningState.cs | 66 + ...overyPointModelCollection.Serialization.cs | 50 + .../Models/RecoveryPointModelCollection.cs | 37 + ...ointModelCustomProperties.Serialization.cs | 30 + .../RecoveryPointModelCustomProperties.cs | 32 + .../RecoveryPointModelData.Serialization.cs | 63 + ...overyPointModelProperties.Serialization.cs | 46 + .../Models/RecoveryPointModelProperties.cs | 45 + .../src/Generated/Models/RecoveryPointType.cs | 51 + ...nExtensionModelCollection.Serialization.cs | 50 + .../ReplicationExtensionModelCollection.cs | 37 + ...sionModelCustomProperties.Serialization.cs | 40 + ...plicationExtensionModelCustomProperties.cs | 32 + ...icationExtensionModelData.Serialization.cs | 71 + ...nExtensionModelProperties.Serialization.cs | 51 + .../ReplicationExtensionModelProperties.cs | 52 + .../Generated/Models/ReplicationVaultType.cs | 51 + .../Models/ResynchronizationState.cs | 57 + ...torageContainerProperties.Serialization.cs | 49 + .../Models/StorageContainerProperties.cs | 34 + .../Models/TaskModel.Serialization.cs | 91 ++ .../src/Generated/Models/TaskModel.cs | 60 + ...TaskModelCustomProperties.Serialization.cs | 33 + .../Models/TaskModelCustomProperties.cs | 29 + .../src/Generated/Models/TaskState.cs | 63 + ...flowModelCustomProperties.Serialization.cs | 55 + ...verCleanupWorkflowModelCustomProperties.cs | 34 + .../src/Generated/Models/TestFailoverState.cs | 72 + ...flowModelCustomProperties.Serialization.cs | 64 + ...stFailoverWorkflowModelCustomProperties.cs | 36 + ...nDraModelCustomProperties.Serialization.cs | 41 + .../Models/UnknownDraModelCustomProperties.cs | 20 + ...ventModelCustomProperties.Serialization.cs | 33 + .../UnknownEventModelCustomProperties.cs | 20 + ...bricModelCustomProperties.Serialization.cs | 41 + .../UnknownFabricModelCustomProperties.cs | 20 + ...overModelCustomProperties.Serialization.cs | 41 + ...ownPlannedFailoverModelCustomProperties.cs | 20 + ...licyModelCustomProperties.Serialization.cs | 41 + .../UnknownPolicyModelCustomProperties.cs | 20 + ...ItemModelCustomProperties.Serialization.cs | 41 + ...knownProtectedItemModelCustomProperties.cs | 20 + ...ointModelCustomProperties.Serialization.cs | 33 + ...knownRecoveryPointModelCustomProperties.cs | 20 + ...sionModelCustomProperties.Serialization.cs | 41 + ...plicationExtensionModelCustomProperties.cs | 20 + ...flowModelCustomProperties.Serialization.cs | 49 + .../UnknownWorkflowModelCustomProperties.cs | 23 + ...eDraModelCustomProperties.Serialization.cs | 57 + .../Models/VMwareDraModelCustomProperties.cs | 46 + ...bricModelCustomProperties.Serialization.cs | 57 + ...MwareMigrateFabricModelCustomProperties.cs | 46 + ...wareToAzStackHCIDiskInput.Serialization.cs | 91 ++ .../Models/VMwareToAzStackHCIDiskInput.cs | 69 + ...MwareToAzStackHCINicInput.Serialization.cs | 79 + .../Models/VMwareToAzStackHCINicInput.cs | 67 + ...overModelCustomProperties.Serialization.cs | 49 + ...HCIPlannedFailoverModelCustomProperties.cs | 33 + ...licyModelCustomProperties.Serialization.cs | 65 + ...ToAzStackHCIPolicyModelCustomProperties.cs | 54 + ...CIProtectedDiskProperties.Serialization.cs | 105 ++ ...wareToAzStackHCIProtectedDiskProperties.cs | 74 + ...ItemModelCustomProperties.Serialization.cs | 493 ++++++ ...ckHCIProtectedItemModelCustomProperties.cs | 268 ++++ ...HCIProtectedNicProperties.Serialization.cs | 83 + ...MwareToAzStackHCIProtectedNicProperties.cs | 56 + ...sionModelCustomProperties.Serialization.cs | 164 ++ ...plicationExtensionModelCustomProperties.cs | 102 ++ .../Models/VMwareToAzureMigrateResyncState.cs | 54 + .../VaultModelCollection.Serialization.cs | 50 + .../Generated/Models/VaultModelCollection.cs | 37 + .../Models/VaultModelData.Serialization.cs | 113 ++ .../Models/VaultModelPatch.Serialization.cs | 37 + .../src/Generated/Models/VaultModelPatch.cs | 28 + .../VaultModelProperties.Serialization.cs | 64 + .../Generated/Models/VaultModelProperties.cs | 36 + .../src/Generated/Models/VmNicSelection.cs | 57 + .../WorkflowModelCollection.Serialization.cs | 50 + .../Models/WorkflowModelCollection.cs | 37 + ...flowModelCustomProperties.Serialization.cs | 32 + .../Models/WorkflowModelCustomProperties.cs | 40 + .../Models/WorkflowModelData.Serialization.cs | 63 + .../WorkflowModelProperties.Serialization.cs | 174 ++ .../Models/WorkflowModelProperties.cs | 116 ++ .../Generated/Models/WorkflowObjectType.cs | 69 + .../src/Generated/Models/WorkflowState.cs | 72 + .../src/Generated/PolicyModelCollection.cs | 341 ++++ .../src/Generated/PolicyModelData.cs | 45 + .../src/Generated/PolicyModelResource.cs | 372 +++++ .../Generated/ProtectedItemModelCollection.cs | 341 ++++ .../src/Generated/ProtectedItemModelData.cs | 45 + .../Generated/ProtectedItemModelResource.cs | 497 ++++++ .../src/Generated/ProviderConstants.cs | 16 + .../Generated/RecoveryPointModelCollection.cs | 259 +++ .../src/Generated/RecoveryPointModelData.cs | 45 + .../Generated/RecoveryPointModelResource.cs | 153 ++ .../ReplicationExtensionModelCollection.cs | 341 ++++ .../ReplicationExtensionModelData.cs | 45 + .../ReplicationExtensionModelResource.cs | 372 +++++ ...overyManagementServiceAPIRestOperations.cs | 208 +++ .../DraOperationStatusRestOperations.cs | 130 ++ .../RestOperations/DraRestOperations.cs | 443 +++++ .../EmailConfigurationRestOperations.cs | 377 +++++ .../RestOperations/EventRestOperations.cs | 299 ++++ .../FabricOperationsStatusRestOperations.cs | 124 ++ .../RestOperations/FabricRestOperations.cs | 644 ++++++++ .../PolicyOperationStatusRestOperations.cs | 130 ++ .../RestOperations/PolicyRestOperations.cs | 443 +++++ ...tectedItemOperationStatusRestOperations.cs | 130 ++ .../ProtectedItemRestOperations.cs | 535 ++++++ .../RecoveryPointsRestOperations.cs | 299 ++++ ...nExtensionOperationStatusRestOperations.cs | 130 ++ .../ReplicationExtensionRestOperations.cs | 443 +++++ .../VaultOperationStatusRestOperations.cs | 124 ++ .../RestOperations/VaultRestOperations.cs | 644 ++++++++ .../WorkflowOperationStatusRestOperations.cs | 130 ++ .../RestOperations/WorkflowRestOperations.cs | 299 ++++ .../src/Generated/VaultModelCollection.cs | 344 ++++ .../src/Generated/VaultModelData.cs | 43 + .../src/Generated/VaultModelResource.cs | 1002 ++++++++++++ .../src/Generated/WorkflowModelCollection.cs | 263 +++ .../src/Generated/WorkflowModelData.cs | 45 + .../src/Generated/WorkflowModelResource.cs | 228 +++ .../src/Properties/AssemblyInfo.cs | 9 + .../src/autorest.md | 49 + ...coveryservicesdatareplication.Tests.csproj | 5 + ...rvicesdatareplicationManagementTestBase.cs | 43 + ...atareplicationManagementTestEnvironment.cs | 11 + .../ci.mgmt.yml | 24 + 274 files changed, 30005 insertions(+) create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication.sln create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/CHANGELOG.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Directory.Build.props create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/README.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/api/Azure.ResourceManager.Recoveryservicesdatareplication.netstandard2.0.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/assets.json create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/Azure.ResourceManager.Recoveryservicesdatareplication.Samples.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/autorest.tests.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Azure.ResourceManager.Recoveryservicesdatareplication.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ArmRecoveryservicesdatareplicationModelFactory.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/RecoveryservicesdatareplicationExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/DraModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperationOfT.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemActiveLocation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectionState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationVaultType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ResynchronizationState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VmNicSelection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowObjectType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProviderConstants.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/AzureSiteRecoveryManagementServiceAPIRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EventRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricOperationsStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/RecoveryPointsRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowOperationStatusRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Properties/AssemblyInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/autorest.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/Azure.ResourceManager.Recoveryservicesdatareplication.Tests.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestBase.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestEnvironment.cs create mode 100644 sdk/recoveryservicesdatareplication/ci.mgmt.yml diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication.sln b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication.sln new file mode 100644 index 000000000000..0047ac6d876d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FCE207DE-56E1-40F8-8AE4-99039FC11F51}") = "Azure.ResourceManager.Recoveryservicesdatareplication", "src\Azure.ResourceManager.Recoveryservicesdatareplication.csproj", "{5F2E794D-6154-44F2-8E29-CF6DD15198FA}" +EndProject +Project("{FCE207DE-56E1-40F8-8AE4-99039FC11F51}") = "Azure.ResourceManager.Recoveryservicesdatareplication.Tests", "tests\Azure.ResourceManager.Recoveryservicesdatareplication.Tests.csproj", "{4E5890C0-3D38-454C-84F8-9F91B2CEB289}" +EndProject +Project("{FCE207DE-56E1-40F8-8AE4-99039FC11F51}") = "Azure.ResourceManager.Recoveryservicesdatareplication.Samples", "samples\Azure.ResourceManager.Recoveryservicesdatareplication.Samples.csproj", "{E33621C5-B942-46C1-9662-B0657455EED2}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A62A3726-93EB-429C-97B9-B9C349994CA5} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|x64.ActiveCfg = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|x64.Build.0 = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|x86.ActiveCfg = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Debug|x86.Build.0 = Debug|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|Any CPU.Build.0 = Release|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|x64.ActiveCfg = Release|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|x64.Build.0 = Release|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|x86.ActiveCfg = Release|Any CPU + {5F2E794D-6154-44F2-8E29-CF6DD15198FA}.Release|x86.Build.0 = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|x64.ActiveCfg = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|x64.Build.0 = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|x86.ActiveCfg = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Debug|x86.Build.0 = Debug|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|Any CPU.Build.0 = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|x64.ActiveCfg = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|x64.Build.0 = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|x86.ActiveCfg = Release|Any CPU + {4E5890C0-3D38-454C-84F8-9F91B2CEB289}.Release|x86.Build.0 = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|x64.ActiveCfg = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|x64.Build.0 = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|x86.ActiveCfg = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Debug|x86.Build.0 = Debug|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|Any CPU.Build.0 = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|x64.ActiveCfg = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|x64.Build.0 = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|x86.ActiveCfg = Release|Any CPU + {E33621C5-B942-46C1-9662-B0657455EED2}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/CHANGELOG.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/CHANGELOG.md new file mode 100644 index 000000000000..23f86d1e896e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### General New Features + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Directory.Build.props b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/README.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/README.md new file mode 100644 index 000000000000..2541dd8b5621 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure recoveryservicesdatareplication management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure recoveryservicesdatareplication management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Recoveryservicesdatareplication --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/api/Azure.ResourceManager.Recoveryservicesdatareplication.netstandard2.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/api/Azure.ResourceManager.Recoveryservicesdatareplication.netstandard2.0.cs new file mode 100644 index 000000000000..04d112a0bd7c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/api/Azure.ResourceManager.Recoveryservicesdatareplication.netstandard2.0.cs @@ -0,0 +1,1427 @@ +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class DraModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DraModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DraModelData : Azure.ResourceManager.Models.ResourceData + { + public DraModelData(Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelProperties Properties { get { throw null; } set { } } + } + public partial class DraModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DraModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDraOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDraOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EmailConfigurationModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EmailConfigurationModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EmailConfigurationModelData : Azure.ResourceManager.Models.ResourceData + { + public EmailConfigurationModelData(Azure.ResourceManager.Recoveryservicesdatareplication.Models.EmailConfigurationModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.EmailConfigurationModelProperties Properties { get { throw null; } set { } } + } + public partial class EmailConfigurationModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EmailConfigurationModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EventModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EventModelCollection() { } + public virtual Azure.Response Exists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EventModelData : Azure.ResourceManager.Models.ResourceData + { + internal EventModelData() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelProperties Properties { get { throw null; } } + } + public partial class EventModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EventModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.EventModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FabricModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FabricModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FabricModelData : Azure.ResourceManager.Models.TrackedResourceData + { + public FabricModelData(Azure.Core.AzureLocation location, Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelProperties properties) : base (default(Azure.Core.AzureLocation)) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + } + public partial class FabricModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FabricModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDraModel(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDraModelAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.DraModelCollection GetDraModels() { throw null; } + public virtual Azure.Response GetFabricOperationsStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFabricOperationsStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PolicyModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PolicyModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PolicyModelData : Azure.ResourceManager.Models.ResourceData + { + public PolicyModelData(Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelProperties Properties { get { throw null; } set { } } + } + public partial class PolicyModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PolicyModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPolicyOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPolicyOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ProtectedItemModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProtectedItemModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ProtectedItemModelData : Azure.ResourceManager.Models.ResourceData + { + public ProtectedItemModelData(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelProperties Properties { get { throw null; } set { } } + } + public partial class ProtectedItemModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProtectedItemModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProtectedItemOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProtectedItemOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRecoveryPointModel(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRecoveryPointModelAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.RecoveryPointModelCollection GetRecoveryPointModels() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RecoveryPointModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RecoveryPointModelCollection() { } + public virtual Azure.Response Exists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RecoveryPointModelData : Azure.ResourceManager.Models.ResourceData + { + internal RecoveryPointModelData() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelProperties Properties { get { throw null; } } + } + public partial class RecoveryPointModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RecoveryPointModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.RecoveryPointModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class RecoveryservicesdatareplicationExtensions + { + public static Azure.Response CheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Recoveryservicesdatareplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> CheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.Recoveryservicesdatareplication.Models.CheckNameAvailabilityModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response DeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> DeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.DeploymentPreflightModel body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.DraModelResource GetDraModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelResource GetEmailConfigurationModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.EventModelResource GetEventModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFabricModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFabricModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelResource GetFabricModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelCollection GetFabricModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFabricModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFabricModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelResource GetPolicyModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelResource GetProtectedItemModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.RecoveryPointModelResource GetRecoveryPointModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelResource GetReplicationExtensionModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetVaultModel(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetVaultModelAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelResource GetVaultModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelCollection GetVaultModels(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetVaultModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetVaultModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.WorkflowModelResource GetWorkflowModelResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class ReplicationExtensionModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReplicationExtensionModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ReplicationExtensionModelData : Azure.ResourceManager.Models.ResourceData + { + public ReplicationExtensionModelData(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelProperties Properties { get { throw null; } set { } } + } + public partial class ReplicationExtensionModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReplicationExtensionModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetReplicationExtensionOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReplicationExtensionOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class VaultModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected VaultModelCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class VaultModelData : Azure.ResourceManager.Models.TrackedResourceData + { + public VaultModelData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + } + public partial class VaultModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected VaultModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEmailConfigurationModel(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEmailConfigurationModelAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelCollection GetEmailConfigurationModels() { throw null; } + public virtual Azure.Response GetEventModel(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEventModelAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.EventModelCollection GetEventModels() { throw null; } + public virtual Azure.Response GetPolicyModel(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPolicyModelAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelCollection GetPolicyModels() { throw null; } + public virtual Azure.Response GetProtectedItemModel(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProtectedItemModelAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelCollection GetProtectedItemModels() { throw null; } + public virtual Azure.Response GetReplicationExtensionModel(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReplicationExtensionModelAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelCollection GetReplicationExtensionModels() { throw null; } + public virtual Azure.Response GetVaultOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetVaultOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkflowModel(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowModelAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.WorkflowModelCollection GetWorkflowModels() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkflowModelCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkflowModelCollection() { } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkflowModelData : Azure.ResourceManager.Models.ResourceData + { + internal WorkflowModelData() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelProperties Properties { get { throw null; } } + } + public partial class WorkflowModelResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkflowModelResource() { } + public virtual Azure.ResourceManager.Recoveryservicesdatareplication.WorkflowModelData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkflowOperationStatu(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowOperationStatuAsync(string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public static partial class ArmRecoveryservicesdatareplicationModelFactory + { + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.AzStackHCIFabricModelCustomProperties AzStackHCIFabricModelCustomProperties(string azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.AzStackHCIClusterProperties cluster = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.CheckNameAvailabilityResponseModel CheckNameAvailabilityResponseModel(bool? nameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.DraModelData DraModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelProperties DraModelProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel authenticationIdentity = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeat = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.EmailConfigurationModelData EmailConfigurationModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.EmailConfigurationModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ErrorModel ErrorModel(string code = null, string errorModelType = null, string severity = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.EventModelData EventModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelProperties EventModelProperties(string resourceType = null, string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? timeOfOccurrence = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.FabricModelData FabricModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelProperties FabricModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), string serviceEndpoint = null, string serviceResourceId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus? health = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, System.DateTimeOffset? recoveryPointOn = default(System.DateTimeOffset?), string networkName = null, string subnet = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.FailoverWorkflowModelCustomProperties FailoverWorkflowModelCustomProperties(System.Collections.Generic.IReadOnlyDictionary affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthErrorModel HealthErrorModel(string affectedResourceType = null, System.Collections.Generic.IEnumerable affectedResourceCorrelationIds = null, System.Collections.Generic.IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVMigrateFabricModelCustomProperties HyperVMigrateFabricModelCustomProperties(string hyperVSiteId = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIEventModelCustomProperties HyperVToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCINicInput HyperVToAzStackHCINicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIProtectedDiskProperties HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIProtectedItemModelCustomProperties HyperVToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string fabricDiscoveryMachineId = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string targetVmName = null, string targetResourceGroupId = null, string storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string runAsAccountId = null, string sourceDraName = null, string targetDraName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIProtectedNicProperties HyperVToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIRecoveryPointModelCustomProperties HyperVToAzStackHCIRecoveryPointModelCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HyperVToAzStackHCIReplicationExtensionModelCustomProperties HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId = null, string hyperVSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.InnerHealthErrorModel InnerHealthErrorModel(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.OperationStatus OperationStatus(string id = null, string name = null, string status = null, string startTime = null, string endTime = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.PolicyModelData PolicyModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelProperties PolicyModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.ProtectedItemModelData ProtectedItemModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelProperties ProtectedItemModelProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState? protectionState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState? testFailoverState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState? resynchronizationState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string draId = null, string targetDraId = null, bool? resyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesCurrentJob currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedEnableProtectionJob lastFailedEnableProtectionJob = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedPlannedFailoverJob lastFailedPlannedFailoverJob = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastTestFailoverJob lastTestFailoverJob = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus? replicationHealth = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesCurrentJob ProtectedItemModelPropertiesCurrentJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedEnableProtectionJob ProtectedItemModelPropertiesLastFailedEnableProtectionJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedPlannedFailoverJob ProtectedItemModelPropertiesLastFailedPlannedFailoverJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastTestFailoverJob ProtectedItemModelPropertiesLastTestFailoverJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.RecoveryPointModelData RecoveryPointModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelProperties RecoveryPointModelProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType recoveryPointType = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType), Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.ReplicationExtensionModelData ReplicationExtensionModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelProperties ReplicationExtensionModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskModel TaskModel(string taskName = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState? state = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenWorkflows = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverCleanupWorkflowModelCustomProperties TestFailoverCleanupWorkflowModelCustomProperties(System.Collections.Generic.IReadOnlyDictionary affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverWorkflowModelCustomProperties TestFailoverWorkflowModelCustomProperties(System.Collections.Generic.IReadOnlyDictionary affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.VaultModelData VaultModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelProperties VaultModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState?), string serviceResourceId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType? vaultType = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzStackHCINicInput VMwareToAzStackHCINicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzStackHCIProtectedDiskProperties VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzStackHCIProtectedItemModelCustomProperties VMwareToAzStackHCIProtectedItemModelCustomProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation?), string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string storageContainerId = null, string targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string osType = null, string osName = null, string firmwareType = null, string fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceDraName = null, string targetDraName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceived = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? migrationProgressPercentage = default(int?), int? resumeProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), long? resyncRetryCount = default(long?), bool? resyncRequired = default(bool?), Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState? resyncState = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState?), bool? performAutoResync = default(bool?), long? resumeRetryCount = default(long?), System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzStackHCIProtectedNicProperties VMwareToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = default(bool?), string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzStackHCIReplicationExtensionModelCustomProperties VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId = null, string vmwareSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties WorkflowModelCustomProperties(string instanceType = null, System.Collections.Generic.IReadOnlyDictionary affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.WorkflowModelData WorkflowModelData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelProperties properties = null) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelProperties WorkflowModelProperties(string displayName = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState? state = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType? objectType = default(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType?), string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, System.Collections.Generic.IEnumerable allowedActions = null, string activityId = null, System.Collections.Generic.IEnumerable tasks = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties customProperties = null) { throw null; } + } + public partial class AzStackHCIClusterProperties + { + public AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, System.Collections.Generic.IEnumerable storageContainers) { } + public string ClusterName { get { throw null; } set { } } + public string ResourceName { get { throw null; } set { } } + public string StorageAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList StorageContainers { get { throw null; } } + } + public partial class AzStackHCIFabricModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties + { + public AzStackHCIFabricModelCustomProperties(string azStackHciSiteId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.AzStackHCIClusterProperties cluster, string migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public string AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.AzStackHCIClusterProperties Cluster { get { throw null; } set { } } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public System.Uri MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + } + public partial class CheckNameAvailabilityModel + { + public CheckNameAvailabilityModel() { } + public string Name { get { throw null; } set { } } + public string ResourceType { get { throw null; } set { } } + } + public partial class CheckNameAvailabilityResponseModel + { + internal CheckNameAvailabilityResponseModel() { } + public string Message { get { throw null; } } + public bool? NameAvailable { get { throw null; } } + public string Reason { get { throw null; } } + } + public partial class DeploymentPreflightModel + { + public DeploymentPreflightModel() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + } + public partial class DeploymentPreflightResource + { + public DeploymentPreflightResource() { } + public string ApiVersion { get { throw null; } set { } } + public string DeploymentPreflightResourceType { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + } + public abstract partial class DraModelCustomProperties + { + protected DraModelCustomProperties() { } + } + public partial class DraModelProperties + { + public DraModelProperties(string machineId, string machineName, Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel authenticationIdentity, Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel resourceAccessIdentity, Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelCustomProperties customProperties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeat { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + } + public partial class EmailConfigurationModelProperties + { + public EmailConfigurationModelProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public bool SendToOwners { get { throw null; } set { } } + } + public partial class ErrorModel + { + internal ErrorModel() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string ErrorModelType { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + } + public abstract partial class EventModelCustomProperties + { + protected EventModelCustomProperties() { } + } + public partial class EventModelProperties + { + internal EventModelProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelCustomProperties CustomProperties { get { throw null; } } + public string Description { get { throw null; } } + public string EventName { get { throw null; } } + public string EventType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public string ResourceName { get { throw null; } } + public string ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + public System.DateTimeOffset? TimeOfOccurrence { get { throw null; } } + } + public abstract partial class FabricModelCustomProperties + { + protected FabricModelCustomProperties() { } + } + public partial class FabricModelPatch : Azure.ResourceManager.Models.ResourceData + { + public FabricModelPatch() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } + public partial class FabricModelProperties + { + public FabricModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties customProperties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + } + public partial class FailoverProtectedItemProperties + { + internal FailoverProtectedItemProperties() { } + public string NetworkName { get { throw null; } } + public string ProtectedItemName { get { throw null; } } + public string RecoveryPointId { get { throw null; } } + public System.DateTimeOffset? RecoveryPointOn { get { throw null; } } + public string Subnet { get { throw null; } } + public string TestVmName { get { throw null; } } + public string VmName { get { throw null; } } + } + public partial class FailoverWorkflowModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties + { + internal FailoverWorkflowModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + } + public partial class HealthErrorModel + { + internal HealthErrorModel() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public string AffectedResourceType { get { throw null; } } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildErrors { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HealthStatus(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HyperVMigrateFabricModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties + { + public HyperVMigrateFabricModelCustomProperties(string hyperVSiteId, string migrationSolutionId) { } + public string FabricContainerId { get { throw null; } } + public string FabricResourceId { get { throw null; } } + public string HyperVSiteId { get { throw null; } set { } } + public System.Uri MigrationHubUri { get { throw null; } } + public string MigrationSolutionId { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIDiskInput + { + public HyperVToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIEventModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.EventModelCustomProperties + { + internal HyperVToAzStackHCIEventModelCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + } + public partial class HyperVToAzStackHCINicInput + { + public HyperVToAzStackHCINicInput(string nicId, string targetNetworkId, string testNetworkId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection selectionTypeForFailover) { } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelCustomProperties + { + public HyperVToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelCustomProperties + { + public HyperVToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIProtectedDiskProperties + { + internal HyperVToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + } + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelCustomProperties + { + public HyperVToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceDraName, string targetDraName, string customLocationRegion) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceDraName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetDraName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + } + public partial class HyperVToAzStackHCIProtectedNicProperties + { + internal HyperVToAzStackHCIProtectedNicProperties() { } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + } + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelCustomProperties + { + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + } + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelCustomProperties + { + public HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId, string azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public string HyperVFabricArmId { get { throw null; } set { } } + public string HyperVSiteId { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + } + public partial class IdentityModel + { + public IdentityModel(System.Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority) { } + public string AadAuthority { get { throw null; } set { } } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public System.Guid TenantId { get { throw null; } set { } } + } + public partial class InnerHealthErrorModel + { + internal InnerHealthErrorModel() { } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + } + public partial class OperationStatus + { + internal OperationStatus() { } + public string EndTime { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string StartTime { get { throw null; } } + public string Status { get { throw null; } } + } + public partial class PlannedFailoverModel + { + public PlannedFailoverModel(Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelProperties properties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelCustomProperties PlannedFailoverModelCustomProperties { get { throw null; } set { } } + } + public abstract partial class PlannedFailoverModelCustomProperties + { + protected PlannedFailoverModelCustomProperties() { } + } + public partial class PlannedFailoverModelProperties + { + public PlannedFailoverModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelCustomProperties customProperties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelCustomProperties CustomProperties { get { throw null; } set { } } + } + public abstract partial class PolicyModelCustomProperties + { + protected PolicyModelCustomProperties() { } + } + public partial class PolicyModelProperties + { + public PolicyModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelCustomProperties customProperties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectedItemActiveLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectedItemActiveLocation(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation Primary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation Recovery { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProtectedItemDynamicMemoryConfig + { + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) { } + public long MaximumMemoryInMegaBytes { get { throw null; } set { } } + public long MinimumMemoryInMegaBytes { get { throw null; } set { } } + public int TargetMemoryBufferPercentage { get { throw null; } set { } } + } + public partial class ProtectedItemJobProperties + { + internal ProtectedItemJobProperties() { } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string ScenarioName { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string State { get { throw null; } } + } + public abstract partial class ProtectedItemModelCustomProperties + { + protected ProtectedItemModelCustomProperties() { } + } + public partial class ProtectedItemModelProperties + { + public ProtectedItemModelProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesCurrentJob CurrentJob { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelCustomProperties CustomProperties { get { throw null; } set { } } + public string DraId { get { throw null; } } + public string FabricId { get { throw null; } } + public string FabricObjectId { get { throw null; } } + public string FabricObjectName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedEnableProtectionJob LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastFailedPlannedFailoverJob LastFailedPlannedFailoverJob { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulPlannedFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulTestFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelPropertiesLastTestFailoverJob LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.HealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState? ResynchronizationState { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetDraId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + } + public partial class ProtectedItemModelPropertiesCurrentJob : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemJobProperties + { + internal ProtectedItemModelPropertiesCurrentJob() { } + } + public partial class ProtectedItemModelPropertiesLastFailedEnableProtectionJob : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemJobProperties + { + internal ProtectedItemModelPropertiesLastFailedEnableProtectionJob() { } + } + public partial class ProtectedItemModelPropertiesLastFailedPlannedFailoverJob : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemJobProperties + { + internal ProtectedItemModelPropertiesLastFailedPlannedFailoverJob() { } + } + public partial class ProtectedItemModelPropertiesLastTestFailoverJob : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemJobProperties + { + internal ProtectedItemModelPropertiesLastTestFailoverJob() { } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectionState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class RecoveryPointModelCustomProperties + { + protected RecoveryPointModelCustomProperties() { } + } + public partial class RecoveryPointModelProperties + { + internal RecoveryPointModelProperties() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointModelCustomProperties CustomProperties { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType RecoveryPointType { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.RecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class ReplicationExtensionModelCustomProperties + { + protected ReplicationExtensionModelCustomProperties() { } + } + public partial class ReplicationExtensionModelProperties + { + public ReplicationExtensionModelProperties(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelCustomProperties customProperties) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.ResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class StorageContainerProperties + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + } + public partial class TaskModel + { + internal TaskModel() { } + public System.Collections.Generic.IReadOnlyList ChildrenWorkflows { get { throw null; } } + public string CustomInstanceType { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TaskState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Failed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Pending { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Started { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TaskState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestFailoverCleanupWorkflowModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties + { + internal TestFailoverCleanupWorkflowModelCustomProperties() { } + public string Comments { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.TestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestFailoverWorkflowModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties + { + internal TestFailoverWorkflowModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + } + public partial class VaultModelPatch : Azure.ResourceManager.Models.ResourceData + { + public VaultModelPatch() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VaultModelProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } + public partial class VaultModelProperties + { + public VaultModelProperties() { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationVaultType? VaultType { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmNicSelection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmNicSelection(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection NotSelected { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection SelectedByDefault { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection SelectedByUser { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection SelectedByUserOverride { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VMwareDraModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.DraModelCustomProperties + { + public VMwareDraModelCustomProperties(string biosId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.IdentityModel MarsAuthenticationIdentity { get { throw null; } set { } } + } + public partial class VMwareMigrateFabricModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.FabricModelCustomProperties + { + public VMwareMigrateFabricModelCustomProperties(string vmwareSiteId, string migrationSolutionId) { } + public string MigrationSolutionId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCIDiskInput + { + public VMwareToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public string StorageContainerId { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCINicInput + { + public VMwareToAzStackHCINicInput(string nicId, string label, string targetNetworkId, string testNetworkId, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection selectionTypeForFailover) { } + public string Label { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.PlannedFailoverModelCustomProperties + { + public VMwareToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.PolicyModelCustomProperties + { + public VMwareToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCIProtectedDiskProperties + { + internal VMwareToAzStackHCIProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public string StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + } + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemModelCustomProperties + { + public VMwareToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string storageContainerId, string targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, string fabricDiscoveryMachineId, string runAsAccountId, string sourceDraName, string targetDraName) { } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public string FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceived { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public int? MigrationProgressPercentage { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public bool? PerformAutoResync { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResumeProgressPercentage { get { throw null; } } + public long? ResumeRetryCount { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public long? ResyncRetryCount { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState? ResyncState { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceDraName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public string StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public string TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetDraName { get { throw null; } set { } } + public string TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + } + public partial class VMwareToAzStackHCIProtectedNicProperties + { + internal VMwareToAzStackHCIProtectedNicProperties() { } + public bool? IsPrimaryNic { get { throw null; } } + public string Label { get { throw null; } } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + } + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : Azure.ResourceManager.Recoveryservicesdatareplication.Models.ReplicationExtensionModelCustomProperties + { + public VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId, string azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public string AzStackHciFabricArmId { get { throw null; } set { } } + public string AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + public string VmwareFabricArmId { get { throw null; } set { } } + public string VmwareSiteId { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VMwareToAzureMigrateResyncState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VMwareToAzureMigrateResyncState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState None { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState PreparedForResynchronization { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState StartedResynchronization { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class WorkflowModelCustomProperties + { + protected WorkflowModelCustomProperties() { } + public System.Collections.Generic.IReadOnlyDictionary AffectedObjectDetails { get { throw null; } } + } + public partial class WorkflowModelProperties + { + internal WorkflowModelProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowModelCustomProperties CustomProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string ObjectId { get { throw null; } } + public string ObjectInternalId { get { throw null; } } + public string ObjectInternalName { get { throw null; } } + public string ObjectName { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType? ObjectType { get { throw null; } } + public string ReplicationProviderId { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WorkflowObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WorkflowObjectType(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType Dra { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowObjectType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WorkflowState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WorkflowState(string value) { throw null; } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Cancelled { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Cancelling { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Failed { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Pending { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Started { get { throw null; } } + public static Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState right) { throw null; } + public static implicit operator Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState left, Azure.ResourceManager.Recoveryservicesdatareplication.Models.WorkflowState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/assets.json b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/assets.json new file mode 100644 index 000000000000..4cbcb64f4d19 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net//Azure.ResourceManager.Recoveryservicesdatareplication", + "Tag": "" +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/Azure.ResourceManager.Recoveryservicesdatareplication.Samples.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/Azure.ResourceManager.Recoveryservicesdatareplication.Samples.csproj new file mode 100644 index 000000000000..8f7a92370288 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/Azure.ResourceManager.Recoveryservicesdatareplication.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/autorest.tests.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/autorest.tests.md new file mode 100644 index 000000000000..a6bebc474916 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/samples/autorest.tests.md @@ -0,0 +1,13 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateTests` to generate code. + +# Azure.ResourceManager.recoveryservicesdatareplication.Tests + +> see https://aka.ms/autorest +``` yaml +require: ../src/autorest.md +include-x-ms-examples-original-file: true +testgen: + sample: true +``` \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Azure.ResourceManager.Recoveryservicesdatareplication.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Azure.ResourceManager.Recoveryservicesdatareplication.csproj new file mode 100644 index 000000000000..b38a1cdf22d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Azure.ResourceManager.Recoveryservicesdatareplication.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.1 + Azure.ResourceManager.Recoveryservicesdatareplication + Azure Resource Manager client SDK for Azure resource provider recoveryservicesdatareplication. + azure;management;arm;resource manager;recoveryservicesdatareplication + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ArmRecoveryservicesdatareplicationModelFactory.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ArmRecoveryservicesdatareplicationModelFactory.cs new file mode 100644 index 000000000000..86668358e5a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ArmRecoveryservicesdatareplicationModelFactory.cs @@ -0,0 +1,887 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Model factory for models. + public static partial class ArmRecoveryservicesdatareplicationModelFactory + { + /// Initializes a new instance of DraModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Dra model properties. + /// A new instance for mocking. + public static DraModelData DraModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DraModelProperties properties = null) + { + return new DraModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of DraModelProperties. + /// Gets or sets the Dra correlation Id. + /// Gets or sets the machine Id where Dra is running. + /// Gets or sets the machine name where Dra is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether Dra is responsive. + /// Gets or sets the time when last heartbeat was sent by the Dra. + /// Gets or sets the Dra version. + /// Gets or sets the provisioning state of the Dra. + /// Gets or sets the list of health errors. + /// + /// Dra model custom properties. + /// 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 DraModelProperties DraModelProperties(string correlationId = null, string machineId = null, string machineName = null, IdentityModel authenticationIdentity = null, IdentityModel resourceAccessIdentity = null, bool? isResponsive = null, DateTimeOffset? lastHeartbeat = null, string versionNumber = null, ProvisioningState? provisioningState = null, IEnumerable healthErrors = null, DraModelCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new DraModelProperties(correlationId, machineId, machineName, authenticationIdentity, resourceAccessIdentity, isResponsive, lastHeartbeat, versionNumber, provisioningState, healthErrors?.ToList(), customProperties); + } + + /// Initializes a new instance of HealthErrorModel. + /// Gets or sets the type of affected resource type. + /// + /// Gets or sets the list of affected resource correlation Ids. This can be used to + /// uniquely identify the count of items affected by a specific category and severity + /// as well as count of item affected by an specific issue. + /// + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static HealthErrorModel HealthErrorModel(string affectedResourceType = null, IEnumerable affectedResourceCorrelationIds = null, IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + affectedResourceCorrelationIds ??= new List(); + childErrors ??= new List(); + + return new HealthErrorModel(affectedResourceType, affectedResourceCorrelationIds?.ToList(), childErrors?.ToList(), code, healthCategory, category, severity, source, createdOn, isCustomerResolvable, summary, message, causes, recommendation); + } + + /// Initializes a new instance of InnerHealthErrorModel. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static InnerHealthErrorModel InnerHealthErrorModel(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + return new InnerHealthErrorModel(code, healthCategory, category, severity, source, createdOn, isCustomerResolvable, summary, message, causes, recommendation); + } + + /// Initializes a new instance of OperationStatus. + /// Gets or sets the Id. + /// Gets or sets the operation name. + /// + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of + /// Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + /// + /// Gets or sets the start time. + /// Gets or sets the end time. + /// A new instance for mocking. + public static OperationStatus OperationStatus(string id = null, string name = null, string status = null, string startTime = null, string endTime = null) + { + return new OperationStatus(id, name, status, startTime, endTime); + } + + /// Initializes a new instance of EmailConfigurationModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Email configuration model properties. + /// A new instance for mocking. + public static EmailConfigurationModelData EmailConfigurationModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EmailConfigurationModelProperties properties = null) + { + return new EmailConfigurationModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of EventModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Event model properties. + /// A new instance for mocking. + public static EventModelData EventModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EventModelProperties properties = null) + { + return new EventModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of EventModelProperties. + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// 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 EventModelProperties EventModelProperties(string resourceType = null, string resourceName = null, string eventType = null, string eventName = null, DateTimeOffset? timeOfOccurrence = null, string severity = null, string description = null, string correlationId = null, IEnumerable healthErrors = null, EventModelCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new EventModelProperties(resourceType, resourceName, eventType, eventName, timeOfOccurrence, severity, description, correlationId, healthErrors?.ToList(), customProperties); + } + + /// Initializes a new instance of FabricModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Fabric model properties. + /// A new instance for mocking. + public static FabricModelData FabricModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FabricModelProperties properties = null) + { + tags ??= new Dictionary(); + + return new FabricModelData(id, name, resourceType, systemData, tags, location, properties); + } + + /// Initializes a new instance of FabricModelProperties. + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// 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 . + /// + /// A new instance for mocking. + public static FabricModelProperties FabricModelProperties(ProvisioningState? provisioningState = null, string serviceEndpoint = null, string serviceResourceId = null, HealthStatus? health = null, IEnumerable healthErrors = null, FabricModelCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new FabricModelProperties(provisioningState, serviceEndpoint, serviceResourceId, health, healthErrors?.ToList(), customProperties); + } + + /// Initializes a new instance of PolicyModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Policy model properties. + /// A new instance for mocking. + public static PolicyModelData PolicyModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyModelProperties properties = null) + { + return new PolicyModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of PolicyModelProperties. + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// 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 . + /// + /// A new instance for mocking. + public static PolicyModelProperties PolicyModelProperties(ProvisioningState? provisioningState = null, PolicyModelCustomProperties customProperties = null) + { + return new PolicyModelProperties(provisioningState, customProperties); + } + + /// Initializes a new instance of ProtectedItemModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// A new instance for mocking. + public static ProtectedItemModelData ProtectedItemModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProtectedItemModelProperties properties = null) + { + return new ProtectedItemModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of ProtectedItemModelProperties. + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the Dra. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the DRA Id. + /// Gets or sets the target DRA Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// + /// Gets or sets the allowed scenarios on the protected item. + /// + /// + /// + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// 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 . + /// + /// A new instance for mocking. + public static ProtectedItemModelProperties ProtectedItemModelProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, ProvisioningState? provisioningState = null, ProtectionState? protectionState = null, string protectionStateDescription = null, TestFailoverState? testFailoverState = null, string testFailoverStateDescription = null, ResynchronizationState? resynchronizationState = null, string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string draId = null, string targetDraId = null, bool? resyncRequired = null, DateTimeOffset? lastSuccessfulPlannedFailoverOn = null, DateTimeOffset? lastSuccessfulUnplannedFailoverOn = null, DateTimeOffset? lastSuccessfulTestFailoverOn = null, ProtectedItemModelPropertiesCurrentJob currentJob = null, IEnumerable allowedJobs = null, ProtectedItemModelPropertiesLastFailedEnableProtectionJob lastFailedEnableProtectionJob = null, ProtectedItemModelPropertiesLastFailedPlannedFailoverJob lastFailedPlannedFailoverJob = null, ProtectedItemModelPropertiesLastTestFailoverJob lastTestFailoverJob = null, HealthStatus? replicationHealth = null, IEnumerable healthErrors = null, ProtectedItemModelCustomProperties customProperties = null) + { + allowedJobs ??= new List(); + healthErrors ??= new List(); + + return new ProtectedItemModelProperties(policyName, replicationExtensionName, correlationId, provisioningState, protectionState, protectionStateDescription, testFailoverState, testFailoverStateDescription, resynchronizationState, fabricObjectId, fabricObjectName, sourceFabricProviderId, targetFabricProviderId, fabricId, targetFabricId, draId, targetDraId, resyncRequired, lastSuccessfulPlannedFailoverOn, lastSuccessfulUnplannedFailoverOn, lastSuccessfulTestFailoverOn, currentJob, allowedJobs?.ToList(), lastFailedEnableProtectionJob, lastFailedPlannedFailoverJob, lastTestFailoverJob, replicationHealth, healthErrors?.ToList(), customProperties); + } + + /// Initializes a new instance of ProtectedItemModelPropertiesCurrentJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + /// A new instance for mocking. + public static ProtectedItemModelPropertiesCurrentJob ProtectedItemModelPropertiesCurrentJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemModelPropertiesCurrentJob(scenarioName, id, name, displayName, state, startOn, endOn); + } + + /// Initializes a new instance of ProtectedItemJobProperties. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + /// A new instance for mocking. + public static ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemJobProperties(scenarioName, id, name, displayName, state, startOn, endOn); + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedEnableProtectionJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + /// A new instance for mocking. + public static ProtectedItemModelPropertiesLastFailedEnableProtectionJob ProtectedItemModelPropertiesLastFailedEnableProtectionJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemModelPropertiesLastFailedEnableProtectionJob(scenarioName, id, name, displayName, state, startOn, endOn); + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedPlannedFailoverJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + /// A new instance for mocking. + public static ProtectedItemModelPropertiesLastFailedPlannedFailoverJob ProtectedItemModelPropertiesLastFailedPlannedFailoverJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemModelPropertiesLastFailedPlannedFailoverJob(scenarioName, id, name, displayName, state, startOn, endOn); + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastTestFailoverJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + /// A new instance for mocking. + public static ProtectedItemModelPropertiesLastTestFailoverJob ProtectedItemModelPropertiesLastTestFailoverJob(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemModelPropertiesLastTestFailoverJob(scenarioName, id, name, displayName, state, startOn, endOn); + } + + /// Initializes a new instance of RecoveryPointModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Recovery point model properties. + /// A new instance for mocking. + public static RecoveryPointModelData RecoveryPointModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RecoveryPointModelProperties properties = null) + { + return new RecoveryPointModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of RecoveryPointModelProperties. + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// 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. + /// A new instance for mocking. + public static RecoveryPointModelProperties RecoveryPointModelProperties(DateTimeOffset recoveryPointOn = default, RecoveryPointType recoveryPointType = default, RecoveryPointModelCustomProperties customProperties = null) + { + if (customProperties == null) + { + throw new ArgumentNullException(nameof(customProperties)); + } + + return new RecoveryPointModelProperties(recoveryPointOn, recoveryPointType, customProperties); + } + + /// Initializes a new instance of ReplicationExtensionModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Replication extension model properties. + /// A new instance for mocking. + public static ReplicationExtensionModelData ReplicationExtensionModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ReplicationExtensionModelProperties properties = null) + { + return new ReplicationExtensionModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of ReplicationExtensionModelProperties. + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// 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 . + /// + /// A new instance for mocking. + public static ReplicationExtensionModelProperties ReplicationExtensionModelProperties(ProvisioningState? provisioningState = null, ReplicationExtensionModelCustomProperties customProperties = null) + { + return new ReplicationExtensionModelProperties(provisioningState, customProperties); + } + + /// Initializes a new instance of CheckNameAvailabilityResponseModel. + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + /// A new instance for mocking. + public static CheckNameAvailabilityResponseModel CheckNameAvailabilityResponseModel(bool? nameAvailable = null, string reason = null, string message = null) + { + return new CheckNameAvailabilityResponseModel(nameAvailable, reason, message); + } + + /// Initializes a new instance of VaultModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Vault properties. + /// A new instance for mocking. + public static VaultModelData VaultModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, VaultModelProperties properties = null) + { + tags ??= new Dictionary(); + + return new VaultModelData(id, name, resourceType, systemData, tags, location, properties); + } + + /// Initializes a new instance of VaultModelProperties. + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// A new instance for mocking. + public static VaultModelProperties VaultModelProperties(ProvisioningState? provisioningState = null, string serviceResourceId = null, ReplicationVaultType? vaultType = null) + { + return new VaultModelProperties(provisioningState, serviceResourceId, vaultType); + } + + /// Initializes a new instance of WorkflowModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Workflow model properties. + /// A new instance for mocking. + public static WorkflowModelData WorkflowModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WorkflowModelProperties properties = null) + { + return new WorkflowModelData(id, name, resourceType, systemData, properties); + } + + /// Initializes a new instance of WorkflowModelProperties. + /// Gets or sets the friendly display name. + /// Gets or sets the workflow state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the workflow. + /// Gets or sets the workflow activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Workflow model custom properties. + /// 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 . + /// + /// A new instance for mocking. + public static WorkflowModelProperties WorkflowModelProperties(string displayName = null, WorkflowState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, WorkflowObjectType? objectType = null, string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, IEnumerable allowedActions = null, string activityId = null, IEnumerable tasks = null, IEnumerable errors = null, WorkflowModelCustomProperties customProperties = null) + { + allowedActions ??= new List(); + tasks ??= new List(); + errors ??= new List(); + + return new WorkflowModelProperties(displayName, state, startOn, endOn, objectId, objectName, objectInternalId, objectInternalName, objectType, replicationProviderId, sourceFabricProviderId, targetFabricProviderId, allowedActions?.ToList(), activityId, tasks?.ToList(), errors?.ToList(), customProperties); + } + + /// Initializes a new instance of TaskModel. + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children workflow models. + /// A new instance for mocking. + public static TaskModel TaskModel(string taskName = null, TaskState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string customInstanceType = null, IEnumerable childrenWorkflows = null) + { + childrenWorkflows ??= new List(); + + return new TaskModel(taskName, state, startOn, endOn, customInstanceType != null ? new TaskModelCustomProperties(customInstanceType) : null, childrenWorkflows?.ToList()); + } + + /// Initializes a new instance of ErrorModel. + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + /// A new instance for mocking. + public static ErrorModel ErrorModel(string code = null, string errorModelType = null, string severity = null, DateTimeOffset? createdOn = null, string message = null, string causes = null, string recommendation = null) + { + return new ErrorModel(code, errorModelType, severity, createdOn, message, causes, recommendation); + } + + /// Initializes a new instance of WorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + /// A new instance for mocking. + public static WorkflowModelCustomProperties WorkflowModelCustomProperties(string instanceType = null, IReadOnlyDictionary affectedObjectDetails = null) + { + affectedObjectDetails ??= new Dictionary(); + + return new UnknownWorkflowModelCustomProperties(instanceType, affectedObjectDetails); + } + + /// Initializes a new instance of AzStackHCIFabricModelCustomProperties. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static AzStackHCIFabricModelCustomProperties AzStackHCIFabricModelCustomProperties(string azStackHciSiteId = null, IEnumerable applianceName = null, AzStackHCIClusterProperties cluster = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, Uri migrationHubUri = null) + { + applianceName ??= new List(); + + return new AzStackHCIFabricModelCustomProperties("AzStackHCI", azStackHciSiteId, applianceName?.ToList(), cluster, fabricResourceId, fabricContainerId, migrationSolutionId, migrationHubUri); + } + + /// Initializes a new instance of FailoverProtectedItemProperties. + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + /// A new instance for mocking. + public static FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, DateTimeOffset? recoveryPointOn = null, string networkName = null, string subnet = null) + { + return new FailoverProtectedItemProperties(protectedItemName, vmName, testVmName, recoveryPointId, recoveryPointOn, networkName, subnet); + } + + /// Initializes a new instance of FailoverWorkflowModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the failed over protected item details. + /// A new instance for mocking. + public static FailoverWorkflowModelCustomProperties FailoverWorkflowModelCustomProperties(IReadOnlyDictionary affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + affectedObjectDetails ??= new Dictionary(); + protectedItemDetails ??= new List(); + + return new FailoverWorkflowModelCustomProperties("FailoverWorkflowDetails", affectedObjectDetails, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of HyperVMigrateFabricModelCustomProperties. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static HyperVMigrateFabricModelCustomProperties HyperVMigrateFabricModelCustomProperties(string hyperVSiteId = null, string fabricResourceId = null, string fabricContainerId = null, string migrationSolutionId = null, Uri migrationHubUri = null) + { + return new HyperVMigrateFabricModelCustomProperties("HyperVMigrate", hyperVSiteId, fabricResourceId, fabricContainerId, migrationSolutionId, migrationHubUri); + } + + /// Initializes a new instance of HyperVToAzStackHCIEventModelCustomProperties. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + /// A new instance for mocking. + public static HyperVToAzStackHCIEventModelCustomProperties HyperVToAzStackHCIEventModelCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new HyperVToAzStackHCIEventModelCustomProperties("HyperVToAzStackHCI", eventSourceFriendlyName, protectedItemFriendlyName, sourceApplianceName, targetApplianceName, serverType); + } + + /// Initializes a new instance of HyperVToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static HyperVToAzStackHCINicInput HyperVToAzStackHCINicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default) + { + return new HyperVToAzStackHCINicInput(nicId, networkName, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedDiskProperties. + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk type. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedDiskProperties HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null) + { + return new HyperVToAzStackHCIProtectedDiskProperties(storageContainerId, storageContainerLocalPath, sourceDiskId, sourceDiskName, seedDiskName, testMigrateDiskName, migrateDiskName, isOSDisk, capacityInBytes, isDynamic, diskType); + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedItemModelCustomProperties HyperVToAzStackHCIProtectedItemModelCustomProperties(ProtectedItemActiveLocation? activeLocation = null, string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string targetVmName = null, string targetResourceGroupId = null, string storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string runAsAccountId = null, string sourceDraName = null, string targetDraName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? resyncProgressPercentage = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new HyperVToAzStackHCIProtectedItemModelCustomProperties("HyperVToAzStackHCI", activeLocation, targetHciClusterId, targetArcClusterCustomLocationId, targetAzStackHciClusterName, fabricDiscoveryMachineId, disksToInclude?.ToList(), nicsToInclude?.ToList(), sourceVmName, sourceCpuCores, sourceMemoryInMegaBytes, targetVmName, targetResourceGroupId, storageContainerId, hyperVGeneration, targetNetworkId, testNetworkId, targetCpuCores, isDynamicRam, dynamicMemoryConfig, targetMemoryInMegaBytes, runAsAccountId, sourceDraName, targetDraName, sourceApplianceName, targetApplianceName, osType, osName, firmwareType, targetLocation, customLocationRegion, failoverRecoveryPointId, lastRecoveryPointReceived, lastRecoveryPointId, initialReplicationProgressPercentage, resyncProgressPercentage, protectedDisks?.ToList(), protectedNics?.ToList(), targetVmBiosId, lastReplicationUpdateOn); + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedNicProperties. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static HyperVToAzStackHCIProtectedNicProperties HyperVToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new HyperVToAzStackHCIProtectedNicProperties(nicId, macAddress, networkName, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + + /// Initializes a new instance of HyperVToAzStackHCIRecoveryPointModelCustomProperties. + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static HyperVToAzStackHCIRecoveryPointModelCustomProperties HyperVToAzStackHCIRecoveryPointModelCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new HyperVToAzStackHCIRecoveryPointModelCustomProperties("HyperVToAzStackHCI", diskIds?.ToList()); + } + + /// Initializes a new instance of HyperVToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static HyperVToAzStackHCIReplicationExtensionModelCustomProperties HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId = null, string hyperVSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, Uri asrServiceUri = null, Uri rcmServiceUri = null, Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new HyperVToAzStackHCIReplicationExtensionModelCustomProperties("HyperVToAzStackHCI", hyperVFabricArmId, hyperVSiteId, azStackHciFabricArmId, azStackHciSiteId, storageAccountId, storageAccountSasSecretName, asrServiceUri, rcmServiceUri, gatewayServiceUri, sourceGatewayServiceId, targetGatewayServiceId, sourceStorageContainerName, targetStorageContainerName, resourceLocation, subscriptionId, resourceGroup); + } + + /// Initializes a new instance of TestFailoverCleanupWorkflowModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test failover cleanup comments. + /// A new instance for mocking. + public static TestFailoverCleanupWorkflowModelCustomProperties TestFailoverCleanupWorkflowModelCustomProperties(IReadOnlyDictionary affectedObjectDetails = null, string comments = null) + { + affectedObjectDetails ??= new Dictionary(); + + return new TestFailoverCleanupWorkflowModelCustomProperties("TestFailoverCleanupWorkflowDetails", affectedObjectDetails, comments); + } + + /// Initializes a new instance of TestFailoverWorkflowModelCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test VM details. + /// A new instance for mocking. + public static TestFailoverWorkflowModelCustomProperties TestFailoverWorkflowModelCustomProperties(IReadOnlyDictionary affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + affectedObjectDetails ??= new Dictionary(); + protectedItemDetails ??= new List(); + + return new TestFailoverWorkflowModelCustomProperties("TestFailoverWorkflowDetails", affectedObjectDetails, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of VMwareToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static VMwareToAzStackHCINicInput VMwareToAzStackHCINicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default) + { + return new VMwareToAzStackHCINicInput(nicId, label, networkName, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedDiskProperties. + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk type. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedDiskProperties VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null) + { + return new VMwareToAzStackHCIProtectedDiskProperties(storageContainerId, storageContainerLocalPath, sourceDiskId, sourceDiskName, seedDiskName, testMigrateDiskName, migrateDiskName, isOSDisk, capacityInBytes, isDynamic, diskType); + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedItemModelCustomProperties VMwareToAzStackHCIProtectedItemModelCustomProperties(ProtectedItemActiveLocation? activeLocation = null, string targetHciClusterId = null, string targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, string storageContainerId = null, string targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string osType = null, string osName = null, string firmwareType = null, string fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string runAsAccountId = null, string sourceDraName = null, string targetDraName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceived = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? migrationProgressPercentage = null, int? resumeProgressPercentage = null, int? resyncProgressPercentage = null, long? resyncRetryCount = null, bool? resyncRequired = null, VMwareToAzureMigrateResyncState? resyncState = null, bool? performAutoResync = null, long? resumeRetryCount = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new VMwareToAzStackHCIProtectedItemModelCustomProperties("VMwareToAzStackHCI", activeLocation, targetHciClusterId, targetArcClusterCustomLocationId, targetAzStackHciClusterName, storageContainerId, targetResourceGroupId, targetLocation, customLocationRegion, disksToInclude?.ToList(), nicsToInclude?.ToList(), protectedDisks?.ToList(), protectedNics?.ToList(), targetVmBiosId, targetVmName, hyperVGeneration, targetNetworkId, testNetworkId, targetCpuCores, isDynamicRam, dynamicMemoryConfig, targetMemoryInMegaBytes, osType, osName, firmwareType, fabricDiscoveryMachineId, sourceVmName, sourceCpuCores, sourceMemoryInMegaBytes, runAsAccountId, sourceDraName, targetDraName, sourceApplianceName, targetApplianceName, failoverRecoveryPointId, lastRecoveryPointReceived, lastRecoveryPointId, initialReplicationProgressPercentage, migrationProgressPercentage, resumeProgressPercentage, resyncProgressPercentage, resyncRetryCount, resyncRequired, resyncState, performAutoResync, resumeRetryCount, lastReplicationUpdateOn); + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedNicProperties. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static VMwareToAzStackHCIProtectedNicProperties VMwareToAzStackHCIProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new VMwareToAzStackHCIProtectedNicProperties(nicId, macAddress, label, isPrimaryNic, networkName, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + + /// Initializes a new instance of VMwareToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static VMwareToAzStackHCIReplicationExtensionModelCustomProperties VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId = null, string vmwareSiteId = null, string azStackHciFabricArmId = null, string azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, Uri asrServiceUri = null, Uri rcmServiceUri = null, Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new VMwareToAzStackHCIReplicationExtensionModelCustomProperties("VMwareToAzStackHCI", vmwareFabricArmId, vmwareSiteId, azStackHciFabricArmId, azStackHciSiteId, storageAccountId, storageAccountSasSecretName, asrServiceUri, rcmServiceUri, gatewayServiceUri, sourceGatewayServiceId, targetGatewayServiceId, sourceStorageContainerName, targetStorageContainerName, resourceLocation, subscriptionId, resourceGroup); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelCollection.cs new file mode 100644 index 000000000000..c60ef9ab6005 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelCollection.cs @@ -0,0 +1,341 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetDraModels method from an instance of . + /// + public partial class DraModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _draModelDraClientDiagnostics; + private readonly DraRestOperations _draModelDraRestClient; + + /// Initializes a new instance of the class for mocking. + protected DraModelCollection() + { + } + + /// 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 DraModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _draModelDraClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", DraModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DraModelResource.ResourceType, out string draModelDraApiVersion); + _draModelDraRestClient = new DraRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, draModelDraApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FabricModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FabricModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Create + /// + /// + /// + /// 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 fabric agent (Dra) name. + /// Dra model. + /// 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 fabricAgentName, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new DraModelOperationSource(Client), _draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Create + /// + /// + /// + /// 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 fabric agent (Dra) name. + /// Dra model. + /// 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 fabricAgentName, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new DraModelOperationSource(Client), _draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, 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 the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) 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 fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.Get"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DraModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.Get"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DraModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// Dra_List + /// + /// + /// + /// 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) => _draModelDraRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _draModelDraRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DraModelResource(Client, DraModelData.DeserializeDraModelData(e)), _draModelDraClientDiagnostics, Pipeline, "DraModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// Dra_List + /// + /// + /// + /// 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) => _draModelDraRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _draModelDraRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DraModelResource(Client, DraModelData.DeserializeDraModelData(e)), _draModelDraClientDiagnostics, Pipeline, "DraModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) 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 fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.Exists"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, 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.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelCollection.Exists"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelData.cs new file mode 100644 index 000000000000..de7c81fa3701 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the DraModel data model. + /// Dra model. + /// + public partial class DraModelData : ResourceData + { + /// Initializes a new instance of DraModelData. + /// Dra model properties. + /// is null. + public DraModelData(DraModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of DraModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Dra model properties. + internal DraModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DraModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Dra model properties. + public DraModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelResource.cs new file mode 100644 index 000000000000..9509ebbb831f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/DraModelResource.cs @@ -0,0 +1,372 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a DraModel 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 GetDraModelResource method. + /// Otherwise you can get one from its parent resource using the GetDraModel method. + /// + public partial class DraModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _draModelDraClientDiagnostics; + private readonly DraRestOperations _draModelDraRestClient; + private readonly ClientDiagnostics _draOperationStatusClientDiagnostics; + private readonly DraOperationStatusRestOperations _draOperationStatusRestClient; + private readonly DraModelData _data; + + /// Initializes a new instance of the class for mocking. + protected DraModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DraModelResource(ArmClient client, DraModelData 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 DraModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _draModelDraClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string draModelDraApiVersion); + _draModelDraRestClient = new DraRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, draModelDraApiVersion); + _draOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _draOperationStatusRestClient = new DraOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics/fabricAgents"; + + /// 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 DraModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Get"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DraModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Get"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DraModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Delete + /// + /// + /// + /// 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 = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Delete"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Delete + /// + /// + /// + /// 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 = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Delete"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Create + /// + /// + /// + /// 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. + /// Dra model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Update"); + scope.Start(); + try + { + var response = await _draModelDraRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new DraModelOperationSource(Client), _draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Create + /// + /// + /// + /// 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. + /// Dra model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _draModelDraClientDiagnostics.CreateScope("DraModelResource.Update"); + scope.Start(); + try + { + var response = _draModelDraRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new DraModelOperationSource(Client), _draModelDraClientDiagnostics, Pipeline, _draModelDraRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Tracks the results of an asynchronous operation on the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}/operations/{operationId} + /// + /// + /// Operation Id + /// DraOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetDraOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _draOperationStatusClientDiagnostics.CreateScope("DraModelResource.GetDraOperationStatu"); + scope.Start(); + try + { + var response = await _draOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}/operations/{operationId} + /// + /// + /// Operation Id + /// DraOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetDraOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _draOperationStatusClientDiagnostics.CreateScope("DraModelResource.GetDraOperationStatu"); + scope.Start(); + try + { + var response = _draOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelCollection.cs new file mode 100644 index 000000000000..d0ea1b8a482c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelCollection.cs @@ -0,0 +1,341 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEmailConfigurationModels method from an instance of . + /// + public partial class EmailConfigurationModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _emailConfigurationModelEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _emailConfigurationModelEmailConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected EmailConfigurationModelCollection() + { + } + + /// 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 EmailConfigurationModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _emailConfigurationModelEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", EmailConfigurationModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EmailConfigurationModelResource.ResourceType, out string emailConfigurationModelEmailConfigurationApiVersion); + _emailConfigurationModelEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, emailConfigurationModelEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Create + /// + /// + /// + /// 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 email configuration name. + /// EmailConfiguration model. + /// 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 emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Create + /// + /// + /// + /// 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 email configuration name. + /// EmailConfiguration model. + /// 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 emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration 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 emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Get"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Get"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfiguration_List + /// + /// + /// + /// 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) => _emailConfigurationModelEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _emailConfigurationModelEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EmailConfigurationModelResource(Client, EmailConfigurationModelData.DeserializeEmailConfigurationModelData(e)), _emailConfigurationModelEmailConfigurationClientDiagnostics, Pipeline, "EmailConfigurationModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfiguration_List + /// + /// + /// + /// 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) => _emailConfigurationModelEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _emailConfigurationModelEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EmailConfigurationModelResource(Client, EmailConfigurationModelData.DeserializeEmailConfigurationModelData(e)), _emailConfigurationModelEmailConfigurationClientDiagnostics, Pipeline, "EmailConfigurationModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration 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 emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Exists"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, 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.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelCollection.Exists"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelData.cs new file mode 100644 index 000000000000..1e14e47d4c3b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the EmailConfigurationModel data model. + /// Email configuration model. + /// + public partial class EmailConfigurationModelData : ResourceData + { + /// Initializes a new instance of EmailConfigurationModelData. + /// Email configuration model properties. + /// is null. + public EmailConfigurationModelData(EmailConfigurationModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of EmailConfigurationModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Email configuration model properties. + internal EmailConfigurationModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EmailConfigurationModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Email configuration model properties. + public EmailConfigurationModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelResource.cs new file mode 100644 index 000000000000..b040d9542a51 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EmailConfigurationModelResource.cs @@ -0,0 +1,229 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing an EmailConfigurationModel along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEmailConfigurationModelResource method. + /// Otherwise you can get one from its parent resource using the GetEmailConfigurationModel method. + /// + public partial class EmailConfigurationModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _emailConfigurationModelEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _emailConfigurationModelEmailConfigurationRestClient; + private readonly EmailConfigurationModelData _data; + + /// Initializes a new instance of the class for mocking. + protected EmailConfigurationModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EmailConfigurationModelResource(ArmClient client, EmailConfigurationModelData 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 EmailConfigurationModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _emailConfigurationModelEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string emailConfigurationModelEmailConfigurationApiVersion); + _emailConfigurationModelEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, emailConfigurationModelEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/alertSettings"; + + /// 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 EmailConfigurationModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Get"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Get"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EmailConfigurationModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Create + /// + /// + /// + /// 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. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Update"); + scope.Start(); + try + { + var response = await _emailConfigurationModelEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Create + /// + /// + /// + /// 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. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _emailConfigurationModelEmailConfigurationClientDiagnostics.CreateScope("EmailConfigurationModelResource.Update"); + scope.Start(); + try + { + var response = _emailConfigurationModelEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(Response.FromValue(new EmailConfigurationModelResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelCollection.cs new file mode 100644 index 000000000000..3afdd5cf8594 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelCollection.cs @@ -0,0 +1,263 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEventModels method from an instance of . + /// + public partial class EventModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _eventModelEventClientDiagnostics; + private readonly EventRestOperations _eventModelEventRestClient; + + /// Initializes a new instance of the class for mocking. + protected EventModelCollection() + { + } + + /// 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 EventModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _eventModelEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", EventModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EventModelResource.ResourceType, out string eventModelEventApiVersion); + _eventModelEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, eventModelEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event 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 eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Get"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Get"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// Event_List + /// + /// + /// + /// Filter string. + /// Continuation token. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _eventModelEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _eventModelEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EventModelResource(Client, EventModelData.DeserializeEventModelData(e)), _eventModelEventClientDiagnostics, Pipeline, "EventModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// Event_List + /// + /// + /// + /// Filter string. + /// Continuation token. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _eventModelEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _eventModelEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EventModelResource(Client, EventModelData.DeserializeEventModelData(e)), _eventModelEventClientDiagnostics, Pipeline, "EventModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event 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 eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Exists"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, 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.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelCollection.Exists"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelData.cs new file mode 100644 index 000000000000..54858f56d248 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the EventModel data model. + /// Event model. + /// + public partial class EventModelData : ResourceData + { + /// Initializes a new instance of EventModelData. + /// Event model properties. + /// is null. + internal EventModelData(EventModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of EventModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Event model properties. + internal EventModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EventModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Event model properties. + public EventModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelResource.cs new file mode 100644 index 000000000000..4a8132f6a94d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/EventModelResource.cs @@ -0,0 +1,153 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing an EventModel along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEventModelResource method. + /// Otherwise you can get one from its parent resource using the GetEventModel method. + /// + public partial class EventModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _eventModelEventClientDiagnostics; + private readonly EventRestOperations _eventModelEventRestClient; + private readonly EventModelData _data; + + /// Initializes a new instance of the class for mocking. + protected EventModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EventModelResource(ArmClient client, EventModelData 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 EventModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _eventModelEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string eventModelEventApiVersion); + _eventModelEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, eventModelEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/events"; + + /// 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 EventModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelResource.Get"); + scope.Start(); + try + { + var response = await _eventModelEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _eventModelEventClientDiagnostics.CreateScope("EventModelResource.Get"); + scope.Start(); + try + { + var response = _eventModelEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EventModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/RecoveryservicesdatareplicationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/RecoveryservicesdatareplicationExtensions.cs new file mode 100644 index 000000000000..24311a192c41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/RecoveryservicesdatareplicationExtensions.cs @@ -0,0 +1,539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// A class to add extension methods to Azure.ResourceManager.Recoveryservicesdatareplication. + public static partial class RecoveryservicesdatareplicationExtensions + { + private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmResource resource) + { + return resource.GetCachedClient(client => + { + return new ResourceGroupResourceExtensionClient(client, resource.Id); + }); + } + + private static ResourceGroupResourceExtensionClient GetResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + { + return client.GetResourceClient(() => + { + return new ResourceGroupResourceExtensionClient(client, scope); + }); + } + + private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmResource resource) + { + return resource.GetCachedClient(client => + { + return new SubscriptionResourceExtensionClient(client, resource.Id); + }); + } + + private static SubscriptionResourceExtensionClient GetSubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier scope) + { + return client.GetResourceClient(() => + { + return new SubscriptionResourceExtensionClient(client, scope); + }); + } + #region DraModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static DraModelResource GetDraModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + DraModelResource.ValidateResourceId(id); + return new DraModelResource(client, id); + } + ); + } + #endregion + + #region EmailConfigurationModelResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static EmailConfigurationModelResource GetEmailConfigurationModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + EmailConfigurationModelResource.ValidateResourceId(id); + return new EmailConfigurationModelResource(client, id); + } + ); + } + #endregion + + #region EventModelResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static EventModelResource GetEventModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + EventModelResource.ValidateResourceId(id); + return new EventModelResource(client, id); + } + ); + } + #endregion + + #region FabricModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static FabricModelResource GetFabricModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + FabricModelResource.ValidateResourceId(id); + return new FabricModelResource(client, id); + } + ); + } + #endregion + + #region PolicyModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static PolicyModelResource GetPolicyModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + PolicyModelResource.ValidateResourceId(id); + return new PolicyModelResource(client, id); + } + ); + } + #endregion + + #region ProtectedItemModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ProtectedItemModelResource GetProtectedItemModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ProtectedItemModelResource.ValidateResourceId(id); + return new ProtectedItemModelResource(client, id); + } + ); + } + #endregion + + #region RecoveryPointModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RecoveryPointModelResource GetRecoveryPointModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + RecoveryPointModelResource.ValidateResourceId(id); + return new RecoveryPointModelResource(client, id); + } + ); + } + #endregion + + #region ReplicationExtensionModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ReplicationExtensionModelResource GetReplicationExtensionModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ReplicationExtensionModelResource.ValidateResourceId(id); + return new ReplicationExtensionModelResource(client, id); + } + ); + } + #endregion + + #region VaultModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static VaultModelResource GetVaultModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + VaultModelResource.ValidateResourceId(id); + return new VaultModelResource(client, id); + } + ); + } + #endregion + + #region WorkflowModelResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowModelResource GetWorkflowModelResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowModelResource.ValidateResourceId(id); + return new WorkflowModelResource(client, id); + } + ); + } + #endregion + + /// Gets a collection of FabricModelResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of FabricModelResources and their operations over a FabricModelResource. + public static FabricModelCollection GetFabricModels(this ResourceGroupResource resourceGroupResource) + { + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetFabricModels(); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static async Task> GetFabricModelAsync(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + return await resourceGroupResource.GetFabricModels().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static Response GetFabricModel(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + return resourceGroupResource.GetFabricModels().Get(fabricName, cancellationToken); + } + + /// Gets a collection of VaultModelResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of VaultModelResources and their operations over a VaultModelResource. + public static VaultModelCollection GetVaultModels(this ResourceGroupResource resourceGroupResource) + { + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetVaultModels(); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static async Task> GetVaultModelAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + return await resourceGroupResource.GetVaultModels().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static Response GetVaultModel(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + return resourceGroupResource.GetVaultModels().Get(vaultName, cancellationToken); + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> DeploymentPreflightAsync(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + return await GetResourceGroupResourceExtensionClient(resourceGroupResource).DeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response DeploymentPreflight(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + return GetResourceGroupResourceExtensionClient(resourceGroupResource).DeploymentPreflight(deploymentId, body, cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFabricModelsAsync(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFabricModelsAsync(continuationToken, cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFabricModels(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetFabricModels(continuationToken, cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability + /// + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public static async Task> CheckNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + return await GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailabilityAsync(location, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability + /// + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public static Response CheckNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).CheckNameAvailability(location, body, cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetVaultModelsAsync(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVaultModelsAsync(continuationToken, cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetVaultModels(this SubscriptionResource subscriptionResource, string continuationToken = null, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetVaultModels(continuationToken, cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs new file mode 100644 index 000000000000..4ba43e0804ef --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// A class to add extension methods to ResourceGroupResource. + internal partial class ResourceGroupResourceExtensionClient : ArmResource + { + private ClientDiagnostics _defaultClientDiagnostics; + private AzureSiteRecoveryManagementServiceAPIRestOperations _defaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected ResourceGroupResourceExtensionClient() + { + } + + /// 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 ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AzureSiteRecoveryManagementServiceAPIRestOperations DefaultRestClient => _defaultRestClient ??= new AzureSiteRecoveryManagementServiceAPIRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FabricModelResources in the ResourceGroupResource. + /// An object representing collection of FabricModelResources and their operations over a FabricModelResource. + public virtual FabricModelCollection GetFabricModels() + { + return GetCachedClient(Client => new FabricModelCollection(Client, Id)); + } + + /// Gets a collection of VaultModelResources in the ResourceGroupResource. + /// An object representing collection of VaultModelResources and their operations over a VaultModelResource. + public virtual VaultModelCollection GetVaultModels() + { + return GetCachedClient(Client => new VaultModelCollection(Client, Id)); + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + public virtual async Task> DeploymentPreflightAsync(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeploymentPreflight"); + scope.Start(); + try + { + var response = await DefaultRestClient.DeploymentPreflightAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs resource deployment validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + public virtual Response DeploymentPreflight(string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + using var scope = DefaultClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeploymentPreflight"); + scope.Start(); + try + { + var response = DefaultRestClient.DeploymentPreflight(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs new file mode 100644 index 000000000000..01dceb8c13d3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// A class to add extension methods to SubscriptionResource. + internal partial class SubscriptionResourceExtensionClient : ArmResource + { + private ClientDiagnostics _fabricModelFabricClientDiagnostics; + private FabricRestOperations _fabricModelFabricRestClient; + private ClientDiagnostics _defaultClientDiagnostics; + private AzureSiteRecoveryManagementServiceAPIRestOperations _defaultRestClient; + private ClientDiagnostics _vaultModelVaultClientDiagnostics; + private VaultRestOperations _vaultModelVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected SubscriptionResourceExtensionClient() + { + } + + /// 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 SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics FabricModelFabricClientDiagnostics => _fabricModelFabricClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", FabricModelResource.ResourceType.Namespace, Diagnostics); + private FabricRestOperations FabricModelFabricRestClient => _fabricModelFabricRestClient ??= new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FabricModelResource.ResourceType)); + private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private AzureSiteRecoveryManagementServiceAPIRestOperations DefaultRestClient => _defaultRestClient ??= new AzureSiteRecoveryManagementServiceAPIRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics VaultModelVaultClientDiagnostics => _vaultModelVaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", VaultModelResource.ResourceType.Namespace, Diagnostics); + private VaultRestOperations VaultModelVaultRestClient => _vaultModelVaultRestClient ??= new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(VaultModelResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_ListBySubscription + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFabricModelsAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FabricModelFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FabricModelFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), FabricModelFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFabricModels", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_ListBySubscription + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFabricModels(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FabricModelFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FabricModelFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), FabricModelFabricClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetFabricModels", "value", "nextLink", cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual async Task> CheckNameAvailabilityAsync(AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailability"); + scope.Start(); + try + { + var response = await DefaultRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, location, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual Response CheckNameAvailability(AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + using var scope = DefaultClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckNameAvailability"); + scope.Start(); + try + { + var response = DefaultRestClient.CheckNameAvailability(Id.SubscriptionId, location, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_ListBySubscription + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetVaultModelsAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultModelVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultModelVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), VaultModelVaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVaultModels", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_ListBySubscription + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetVaultModels(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultModelVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultModelVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), VaultModelVaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetVaultModels", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelCollection.cs new file mode 100644 index 000000000000..e401d9263208 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelCollection.cs @@ -0,0 +1,344 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetFabricModels method from an instance of . + /// + public partial class FabricModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fabricModelFabricClientDiagnostics; + private readonly FabricRestOperations _fabricModelFabricRestClient; + + /// Initializes a new instance of the class for mocking. + protected FabricModelCollection() + { + } + + /// 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 FabricModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricModelFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", FabricModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FabricModelResource.ResourceType, out string fabricModelFabricApiVersion); + _fabricModelFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricModelFabricApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Create + /// + /// + /// + /// 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 fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Create + /// + /// + /// + /// 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 fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, 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 the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric 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 fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Get"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Get"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_List + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fabricModelFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricModelFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), _fabricModelFabricClientDiagnostics, Pipeline, "FabricModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// Fabric_List + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fabricModelFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fabricModelFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FabricModelResource(Client, FabricModelData.DeserializeFabricModelData(e)), _fabricModelFabricClientDiagnostics, Pipeline, "FabricModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric 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 fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Exists"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, 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.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelCollection.Exists"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelData.cs new file mode 100644 index 000000000000..e0649ae8aa30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelData.cs @@ -0,0 +1,49 @@ +// 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.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the FabricModel data model. + /// Fabric model. + /// + public partial class FabricModelData : TrackedResourceData + { + /// Initializes a new instance of FabricModelData. + /// The location. + /// Fabric model properties. + /// is null. + public FabricModelData(AzureLocation location, FabricModelProperties properties) : base(location) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of FabricModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Fabric model properties. + internal FabricModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FabricModelProperties properties) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + } + + /// Fabric model properties. + public FabricModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelResource.cs new file mode 100644 index 000000000000..af41065262ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/FabricModelResource.cs @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a FabricModel 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 GetFabricModelResource method. + /// Otherwise you can get one from its parent resource using the GetFabricModel method. + /// + public partial class FabricModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fabricModelFabricClientDiagnostics; + private readonly FabricRestOperations _fabricModelFabricRestClient; + private readonly ClientDiagnostics _fabricOperationsStatusClientDiagnostics; + private readonly FabricOperationsStatusRestOperations _fabricOperationsStatusRestClient; + private readonly FabricModelData _data; + + /// Initializes a new instance of the class for mocking. + protected FabricModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FabricModelResource(ArmClient client, FabricModelData 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 FabricModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fabricModelFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fabricModelFabricApiVersion); + _fabricModelFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fabricModelFabricApiVersion); + _fabricOperationsStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _fabricOperationsStatusRestClient = new FabricOperationsStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics"; + + /// 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 FabricModelData 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 DraModelResources in the FabricModel. + /// An object representing collection of DraModelResources and their operations over a DraModelResource. + public virtual DraModelCollection GetDraModels() + { + return GetCachedClient(Client => new DraModelCollection(Client, Id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetDraModelAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + return await GetDraModels().GetAsync(fabricAgentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// Dra_Get + /// + /// + /// + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetDraModel(string fabricAgentName, CancellationToken cancellationToken = default) + { + return GetDraModels().Get(fabricAgentName, cancellationToken); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Get"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Get"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FabricModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Delete + /// + /// + /// + /// 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 = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Delete"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Delete + /// + /// + /// + /// 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 = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Delete"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Update + /// + /// + /// + /// 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. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Update"); + scope.Start(); + try + { + var response = await _fabricModelFabricRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Update + /// + /// + /// + /// 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. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.Update"); + scope.Start(); + try + { + var response = _fabricModelFabricRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new FabricModelOperationSource(Client), _fabricModelFabricClientDiagnostics, Pipeline, _fabricModelFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/operations/{operationId} + /// + /// + /// Operation Id + /// FabricOperationsStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetFabricOperationsStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _fabricOperationsStatusClientDiagnostics.CreateScope("FabricModelResource.GetFabricOperationsStatu"); + scope.Start(); + try + { + var response = await _fabricOperationsStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/operations/{operationId} + /// + /// + /// Operation Id + /// FabricOperationsStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetFabricOperationsStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _fabricOperationsStatusClientDiagnostics.CreateScope("FabricModelResource.GetFabricOperationsStatu"); + scope.Start(); + try + { + var response = _fabricOperationsStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _fabricModelFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// Fabric_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fabricModelFabricClientDiagnostics.CreateScope("FabricModelResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _fabricModelFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FabricModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FabricModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/DraModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/DraModelOperationSource.cs new file mode 100644 index 000000000000..1904665aad52 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/DraModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class DraModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DraModelOperationSource(ArmClient client) + { + _client = client; + } + + DraModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DraModelData.DeserializeDraModelData(document.RootElement); + return new DraModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DraModelData.DeserializeDraModelData(document.RootElement); + return new DraModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs new file mode 100644 index 000000000000..8e5542f99158 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/FabricModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class FabricModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FabricModelOperationSource(ArmClient client) + { + _client = client; + } + + FabricModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = FabricModelData.DeserializeFabricModelData(document.RootElement); + return new FabricModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = FabricModelData.DeserializeFabricModelData(document.RootElement); + return new FabricModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs new file mode 100644 index 000000000000..05c419507c9f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PlannedFailoverModelOperationSource.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class PlannedFailoverModelOperationSource : IOperationSource + { + PlannedFailoverModel IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return PlannedFailoverModel.DeserializePlannedFailoverModel(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return PlannedFailoverModel.DeserializePlannedFailoverModel(document.RootElement); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs new file mode 100644 index 000000000000..bce324c389c4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/PolicyModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class PolicyModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PolicyModelOperationSource(ArmClient client) + { + _client = client; + } + + PolicyModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return new PolicyModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return new PolicyModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs new file mode 100644 index 000000000000..4834e209d934 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ProtectedItemModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class ProtectedItemModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ProtectedItemModelOperationSource(ArmClient client) + { + _client = client; + } + + ProtectedItemModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return new ProtectedItemModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return new ProtectedItemModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperation.cs new file mode 100644 index 000000000000..85531920bfdf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperation.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryservicesdatareplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + + /// Initializes a new instance of RecoveryservicesdatareplicationArmOperation for mocking. + protected RecoveryservicesdatareplicationArmOperation() + { + } + + internal RecoveryservicesdatareplicationArmOperation(Response response) + { + _operation = OperationInternal.Succeeded(response); + } + + internal RecoveryservicesdatareplicationArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "RecoveryservicesdatareplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + /// +#pragma warning disable CA1822 + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public override string Id => throw new NotImplementedException(); +#pragma warning restore CA1822 + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperationOfT.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperationOfT.cs new file mode 100644 index 000000000000..52968c7014bc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/RecoveryservicesdatareplicationArmOperationOfT.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryservicesdatareplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + + /// Initializes a new instance of RecoveryservicesdatareplicationArmOperation for mocking. + protected RecoveryservicesdatareplicationArmOperation() + { + } + + internal RecoveryservicesdatareplicationArmOperation(Response response) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + } + + internal RecoveryservicesdatareplicationArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "RecoveryservicesdatareplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + /// +#pragma warning disable CA1822 + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public override string Id => throw new NotImplementedException(); +#pragma warning restore CA1822 + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs new file mode 100644 index 000000000000..cebe50833c97 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/ReplicationExtensionModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class ReplicationExtensionModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ReplicationExtensionModelOperationSource(ArmClient client) + { + _client = client; + } + + ReplicationExtensionModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return new ReplicationExtensionModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return new ReplicationExtensionModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs new file mode 100644 index 000000000000..ebbbb3e5b9e0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/LongRunningOperation/VaultModelOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal class VaultModelOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal VaultModelOperationSource(ArmClient client) + { + _client = client; + } + + VaultModelResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = VaultModelData.DeserializeVaultModelData(document.RootElement); + return new VaultModelResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = VaultModelData.DeserializeVaultModelData(document.RootElement); + return new VaultModelResource(_client, data); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs new file mode 100644 index 000000000000..99f8d0087f81 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.Serialization.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class AzStackHCIClusterProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + writer.WritePropertyName("storageAccountName"u8); + writer.WriteStringValue(StorageAccountName); + writer.WritePropertyName("storageContainers"u8); + writer.WriteStartArray(); + foreach (var item in StorageContainers) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + internal static AzStackHCIClusterProperties DeserializeAzStackHCIClusterProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterName = default; + string resourceName = default; + string storageAccountName = default; + IList storageContainers = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountName"u8)) + { + storageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StorageContainerProperties.DeserializeStorageContainerProperties(item)); + } + storageContainers = array; + continue; + } + } + return new AzStackHCIClusterProperties(clusterName, resourceName, storageAccountName, storageContainers); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.cs new file mode 100644 index 000000000000..6cba6c0c0233 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIClusterProperties.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// AzStackHCI cluster properties. + public partial class AzStackHCIClusterProperties + { + /// Initializes a new instance of AzStackHCIClusterProperties. + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + /// , , or is null. + public AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, IEnumerable storageContainers) + { + Argument.AssertNotNull(clusterName, nameof(clusterName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + Argument.AssertNotNull(storageAccountName, nameof(storageAccountName)); + Argument.AssertNotNull(storageContainers, nameof(storageContainers)); + + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers.ToList(); + } + + /// Initializes a new instance of AzStackHCIClusterProperties. + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + internal AzStackHCIClusterProperties(string clusterName, string resourceName, string storageAccountName, IList storageContainers) + { + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers; + } + + /// Gets or sets the AzStackHCICluster FQDN name. + public string ClusterName { get; set; } + /// Gets or sets the AzStackHCICluster resource name. + public string ResourceName { get; set; } + /// Gets or sets the Storage account name. + public string StorageAccountName { get; set; } + /// Gets or sets the list of AzStackHCICluster Storage Container. + public IList StorageContainers { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..7d1efb7c3ce9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class AzStackHCIFabricModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + writer.WritePropertyName("cluster"u8); + writer.WriteObjectValue(Cluster); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static AzStackHCIFabricModelCustomProperties DeserializeAzStackHCIFabricModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string azStackHciSiteId = default; + Optional> applianceName = default; + AzStackHCIClusterProperties cluster = default; + Optional fabricResourceId = default; + Optional fabricContainerId = default; + string migrationSolutionId = default; + Optional migrationHubUri = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("applianceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + applianceName = array; + continue; + } + if (property.NameEquals("cluster"u8)) + { + cluster = AzStackHCIClusterProperties.DeserializeAzStackHCIClusterProperties(property.Value); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + fabricResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + fabricContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationHubUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new AzStackHCIFabricModelCustomProperties(instanceType, azStackHciSiteId, Optional.ToList(applianceName), cluster, fabricResourceId.Value, fabricContainerId.Value, migrationSolutionId, migrationHubUri.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs new file mode 100644 index 000000000000..e84f556f84cb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/AzStackHCIFabricModelCustomProperties.cs @@ -0,0 +1,71 @@ +// 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.Recoveryservicesdatareplication.Models +{ + /// AzStackHCI fabric model custom properties. + public partial class AzStackHCIFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of AzStackHCIFabricModelCustomProperties. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// AzStackHCI cluster properties. + /// Gets or sets the Migration solution ARM Id. + /// , or is null. + public AzStackHCIFabricModelCustomProperties(string azStackHciSiteId, AzStackHCIClusterProperties cluster, string migrationSolutionId) + { + Argument.AssertNotNull(azStackHciSiteId, nameof(azStackHciSiteId)); + Argument.AssertNotNull(cluster, nameof(cluster)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = new ChangeTrackingList(); + Cluster = cluster; + MigrationSolutionId = migrationSolutionId; + InstanceType = "AzStackHCI"; + } + + /// Initializes a new instance of AzStackHCIFabricModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal AzStackHCIFabricModelCustomProperties(string instanceType, string azStackHciSiteId, IReadOnlyList applianceName, AzStackHCIClusterProperties cluster, string fabricResourceId, string fabricContainerId, string migrationSolutionId, Uri migrationHubUri) : base(instanceType) + { + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = applianceName; + Cluster = cluster; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "AzStackHCI"; + } + + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; set; } + /// Gets or sets the Appliance name. + public IReadOnlyList ApplianceName { get; } + /// AzStackHCI cluster properties. + public AzStackHCIClusterProperties Cluster { get; set; } + /// Gets or sets the fabric resource Id. + public string FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public string FabricContainerId { get; } + /// Gets or sets the Migration solution ARM Id. + public string MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public Uri MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs new file mode 100644 index 000000000000..b9d456682600 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class CheckNameAvailabilityModel : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.cs new file mode 100644 index 000000000000..c72836f9adb8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Check name availability model. + public partial class CheckNameAvailabilityModel + { + /// Initializes a new instance of CheckNameAvailabilityModel. + public CheckNameAvailabilityModel() + { + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public string ResourceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs new file mode 100644 index 000000000000..914593ddba7e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class CheckNameAvailabilityResponseModel + { + internal static CheckNameAvailabilityResponseModel DeserializeCheckNameAvailabilityResponseModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nameAvailable = default; + Optional reason = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + } + return new CheckNameAvailabilityResponseModel(Optional.ToNullable(nameAvailable), reason.Value, message.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs new file mode 100644 index 000000000000..f0acb37a0ea3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/CheckNameAvailabilityResponseModel.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Check name availability response model. + public partial class CheckNameAvailabilityResponseModel + { + /// Initializes a new instance of CheckNameAvailabilityResponseModel. + internal CheckNameAvailabilityResponseModel() + { + } + + /// Initializes a new instance of CheckNameAvailabilityResponseModel. + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + internal CheckNameAvailabilityResponseModel(bool? nameAvailable, string reason, string message) + { + NameAvailable = nameAvailable; + Reason = reason; + Message = message; + } + + /// Gets or sets a value indicating whether resource name is available or not. + public bool? NameAvailable { get; } + /// Gets or sets the reason for resource name unavailability. + public string Reason { get; } + /// Gets or sets the message for resource name unavailability. + public string Message { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs new file mode 100644 index 000000000000..2df3b97dfbdd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class DeploymentPreflightModel : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static DeploymentPreflightModel DeserializeDeploymentPreflightModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> resources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentPreflightResource.DeserializeDeploymentPreflightResource(item)); + } + resources = array; + continue; + } + } + return new DeploymentPreflightModel(Optional.ToList(resources)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.cs new file mode 100644 index 000000000000..1c989e688e9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightModel.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Deployment preflight model. + public partial class DeploymentPreflightModel + { + /// Initializes a new instance of DeploymentPreflightModel. + public DeploymentPreflightModel() + { + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of DeploymentPreflightModel. + /// Gets or sets the list of resources. + internal DeploymentPreflightModel(IList resources) + { + Resources = resources; + } + + /// Gets or sets the list of resources. + public IList Resources { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs new file mode 100644 index 000000000000..ec70392ddd0f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.Serialization.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class DeploymentPreflightResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(DeploymentPreflightResourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(DeploymentPreflightResourceType); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(ApiVersion)) + { + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); + } + writer.WriteEndObject(); + } + + internal static DeploymentPreflightResource DeserializeDeploymentPreflightResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional type = default; + Optional location = default; + Optional apiVersion = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + } + return new DeploymentPreflightResource(name.Value, type.Value, Optional.ToNullable(location), apiVersion.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.cs new file mode 100644 index 000000000000..986c4f88a83e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DeploymentPreflightResource.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Deployment preflight resource. + public partial class DeploymentPreflightResource + { + /// Initializes a new instance of DeploymentPreflightResource. + public DeploymentPreflightResource() + { + } + + /// Initializes a new instance of DeploymentPreflightResource. + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Gets or sets the location of the resource. + /// Gets or sets the Api version. + internal DeploymentPreflightResource(string name, string deploymentPreflightResourceType, AzureLocation? location, string apiVersion) + { + Name = name; + DeploymentPreflightResourceType = deploymentPreflightResourceType; + Location = location; + ApiVersion = apiVersion; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public string DeploymentPreflightResourceType { get; set; } + /// Gets or sets the location of the resource. + public AzureLocation? Location { get; set; } + /// Gets or sets the Api version. + public string ApiVersion { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.Serialization.cs new file mode 100644 index 000000000000..de551b7df5e0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class DraModelCollection + { + internal static DraModelCollection DeserializeDraModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(DraModelData.DeserializeDraModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DraModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.cs new file mode 100644 index 000000000000..0b3744240ee5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Dra model collection. + internal partial class DraModelCollection + { + /// Initializes a new instance of DraModelCollection. + internal DraModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of DraModelCollection. + /// Gets or sets the list of Dras. + /// Gets or sets the value of next link. + internal DraModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of Dras. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..820eace549c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class DraModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static DraModelCustomProperties DeserializeDraModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "VMware": return VMwareDraModelCustomProperties.DeserializeVMwareDraModelCustomProperties(element); + } + } + return UnknownDraModelCustomProperties.DeserializeUnknownDraModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.cs new file mode 100644 index 000000000000..f3a934e9f7da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Dra model custom properties. + /// 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 DraModelCustomProperties + { + /// Initializes a new instance of DraModelCustomProperties. + protected DraModelCustomProperties() + { + } + + /// Initializes a new instance of DraModelCustomProperties. + /// Gets or sets the instance type. + internal DraModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelData.Serialization.cs new file mode 100644 index 000000000000..e6849e537fa7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelData.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class DraModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static DraModelData DeserializeDraModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DraModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = DraModelProperties.DeserializeDraModelProperties(property.Value); + 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; + } + } + return new DraModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.Serialization.cs new file mode 100644 index 000000000000..68201ac7e4e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class DraModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("machineId"u8); + writer.WriteStringValue(MachineId); + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("authenticationIdentity"u8); + writer.WriteObjectValue(AuthenticationIdentity); + writer.WritePropertyName("resourceAccessIdentity"u8); + writer.WriteObjectValue(ResourceAccessIdentity); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static DraModelProperties DeserializeDraModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional correlationId = default; + string machineId = default; + string machineName = default; + IdentityModel authenticationIdentity = default; + IdentityModel resourceAccessIdentity = default; + Optional isResponsive = default; + Optional lastHeartbeat = default; + Optional versionNumber = default; + Optional provisioningState = default; + Optional> healthErrors = default; + DraModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineId"u8)) + { + machineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineName"u8)) + { + machineName = property.Value.GetString(); + continue; + } + if (property.NameEquals("authenticationIdentity"u8)) + { + authenticationIdentity = IdentityModel.DeserializeIdentityModel(property.Value); + continue; + } + if (property.NameEquals("resourceAccessIdentity"u8)) + { + resourceAccessIdentity = IdentityModel.DeserializeIdentityModel(property.Value); + continue; + } + if (property.NameEquals("isResponsive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isResponsive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastHeartbeat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastHeartbeat = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("versionNumber"u8)) + { + versionNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(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(HealthErrorModel.DeserializeHealthErrorModel(item)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DraModelCustomProperties.DeserializeDraModelCustomProperties(property.Value); + continue; + } + } + return new DraModelProperties(correlationId.Value, machineId, machineName, authenticationIdentity, resourceAccessIdentity, Optional.ToNullable(isResponsive), Optional.ToNullable(lastHeartbeat), versionNumber.Value, Optional.ToNullable(provisioningState), Optional.ToList(healthErrors), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.cs new file mode 100644 index 000000000000..2aa8b5f6da32 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/DraModelProperties.cs @@ -0,0 +1,102 @@ +// 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.Recoveryservicesdatareplication.Models +{ + /// Dra model properties. + public partial class DraModelProperties + { + /// Initializes a new instance of DraModelProperties. + /// Gets or sets the machine Id where Dra is running. + /// Gets or sets the machine name where Dra is running. + /// Identity model. + /// Identity model. + /// + /// Dra model custom properties. + /// 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 . + /// + /// , , , or is null. + public DraModelProperties(string machineId, string machineName, IdentityModel authenticationIdentity, IdentityModel resourceAccessIdentity, DraModelCustomProperties customProperties) + { + Argument.AssertNotNull(machineId, nameof(machineId)); + Argument.AssertNotNull(machineName, nameof(machineName)); + Argument.AssertNotNull(authenticationIdentity, nameof(authenticationIdentity)); + Argument.AssertNotNull(resourceAccessIdentity, nameof(resourceAccessIdentity)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of DraModelProperties. + /// Gets or sets the Dra correlation Id. + /// Gets or sets the machine Id where Dra is running. + /// Gets or sets the machine name where Dra is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether Dra is responsive. + /// Gets or sets the time when last heartbeat was sent by the Dra. + /// Gets or sets the Dra version. + /// Gets or sets the provisioning state of the Dra. + /// Gets or sets the list of health errors. + /// + /// Dra model custom properties. + /// 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 . + /// + internal DraModelProperties(string correlationId, string machineId, string machineName, IdentityModel authenticationIdentity, IdentityModel resourceAccessIdentity, bool? isResponsive, DateTimeOffset? lastHeartbeat, string versionNumber, ProvisioningState? provisioningState, IReadOnlyList healthErrors, DraModelCustomProperties customProperties) + { + CorrelationId = correlationId; + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + IsResponsive = isResponsive; + LastHeartbeat = lastHeartbeat; + VersionNumber = versionNumber; + ProvisioningState = provisioningState; + HealthErrors = healthErrors; + CustomProperties = customProperties; + } + + /// Gets or sets the Dra correlation Id. + public string CorrelationId { get; } + /// Gets or sets the machine Id where Dra is running. + public string MachineId { get; set; } + /// Gets or sets the machine name where Dra is running. + public string MachineName { get; set; } + /// Identity model. + public IdentityModel AuthenticationIdentity { get; set; } + /// Identity model. + public IdentityModel ResourceAccessIdentity { get; set; } + /// Gets or sets a value indicating whether Dra is responsive. + public bool? IsResponsive { get; } + /// Gets or sets the time when last heartbeat was sent by the Dra. + public DateTimeOffset? LastHeartbeat { get; } + /// Gets or sets the Dra version. + public string VersionNumber { get; } + /// Gets or sets the provisioning state of the Dra. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Dra model custom properties. + /// 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 DraModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.Serialization.cs new file mode 100644 index 000000000000..627c42525e11 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class EmailConfigurationModelCollection + { + internal static EmailConfigurationModelCollection DeserializeEmailConfigurationModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(EmailConfigurationModelData.DeserializeEmailConfigurationModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new EmailConfigurationModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.cs new file mode 100644 index 000000000000..a87342c4ed98 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Email configuration model collection. + internal partial class EmailConfigurationModelCollection + { + /// Initializes a new instance of EmailConfigurationModelCollection. + internal EmailConfigurationModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of EmailConfigurationModelCollection. + /// Gets or sets the list of email configurations. + /// Gets or sets the value of next link. + internal EmailConfigurationModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of email configurations. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelData.Serialization.cs new file mode 100644 index 000000000000..07b7ca627f98 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelData.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class EmailConfigurationModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static EmailConfigurationModelData DeserializeEmailConfigurationModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EmailConfigurationModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EmailConfigurationModelProperties.DeserializeEmailConfigurationModelProperties(property.Value); + 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; + } + } + return new EmailConfigurationModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs new file mode 100644 index 000000000000..cede3838577e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class EmailConfigurationModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("sendToOwners"u8); + writer.WriteBooleanValue(SendToOwners); + if (Optional.IsCollectionDefined(CustomEmailAddresses)) + { + writer.WritePropertyName("customEmailAddresses"u8); + writer.WriteStartArray(); + foreach (var item in CustomEmailAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + } + writer.WriteEndObject(); + } + + internal static EmailConfigurationModelProperties DeserializeEmailConfigurationModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool sendToOwners = default; + Optional> customEmailAddresses = default; + Optional locale = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sendToOwners"u8)) + { + sendToOwners = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("customEmailAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customEmailAddresses = array; + continue; + } + if (property.NameEquals("locale"u8)) + { + locale = property.Value.GetString(); + continue; + } + } + return new EmailConfigurationModelProperties(sendToOwners, Optional.ToList(customEmailAddresses), locale.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.cs new file mode 100644 index 000000000000..c8a7b539562d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EmailConfigurationModelProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Email configuration model properties. + public partial class EmailConfigurationModelProperties + { + /// Initializes a new instance of EmailConfigurationModelProperties. + /// Gets or sets a value indicating whether to send email to subscription administrator. + public EmailConfigurationModelProperties(bool sendToOwners) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of EmailConfigurationModelProperties. + /// Gets or sets a value indicating whether to send email to subscription administrator. + /// Gets or sets the custom email address for sending emails. + /// Gets or sets the locale for the email notification. + internal EmailConfigurationModelProperties(bool sendToOwners, IList customEmailAddresses, string locale) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = customEmailAddresses; + Locale = locale; + } + + /// Gets or sets a value indicating whether to send email to subscription administrator. + public bool SendToOwners { get; set; } + /// Gets or sets the custom email address for sending emails. + public IList CustomEmailAddresses { get; } + /// Gets or sets the locale for the email notification. + public string Locale { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.Serialization.cs new file mode 100644 index 000000000000..a95fabe54269 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ErrorModel + { + internal static ErrorModel DeserializeErrorModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional type = default; + Optional severity = default; + Optional creationTime = default; + Optional message = default; + Optional causes = default; + Optional recommendation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + } + return new ErrorModel(code.Value, type.Value, severity.Value, Optional.ToNullable(creationTime), message.Value, causes.Value, recommendation.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.cs new file mode 100644 index 000000000000..e65261af83ab --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ErrorModel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Error model. + public partial class ErrorModel + { + /// Initializes a new instance of ErrorModel. + internal ErrorModel() + { + } + + /// Initializes a new instance of ErrorModel. + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + internal ErrorModel(string code, string errorModelType, string severity, DateTimeOffset? createdOn, string message, string causes, string recommendation) + { + Code = code; + ErrorModelType = errorModelType; + Severity = severity; + CreatedOn = createdOn; + Message = message; + Causes = causes; + Recommendation = recommendation; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the error type. + public string ErrorModelType { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the creation time of error. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets the possible causes of error. + public string Causes { get; } + /// Gets or sets the recommended action to resolve error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.Serialization.cs new file mode 100644 index 000000000000..950e9edaece0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class EventModelCollection + { + internal static EventModelCollection DeserializeEventModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(EventModelData.DeserializeEventModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new EventModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.cs new file mode 100644 index 000000000000..45055e6fe69a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Event model collection. + internal partial class EventModelCollection + { + /// Initializes a new instance of EventModelCollection. + internal EventModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of EventModelCollection. + /// Gets or sets the list of events. + /// Gets or sets the value of next link. + internal EventModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of events. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..136890c2956a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class EventModelCustomProperties + { + internal static EventModelCustomProperties DeserializeEventModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIEventModelCustomProperties.DeserializeHyperVToAzStackHCIEventModelCustomProperties(element); + } + } + return UnknownEventModelCustomProperties.DeserializeUnknownEventModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.cs new file mode 100644 index 000000000000..4b7b812a23d7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Event model custom properties. + /// 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 EventModelCustomProperties + { + /// Initializes a new instance of EventModelCustomProperties. + protected EventModelCustomProperties() + { + } + + /// Initializes a new instance of EventModelCustomProperties. + /// Gets or sets the instance type. + internal EventModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelData.Serialization.cs new file mode 100644 index 000000000000..45accdc573ad --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelData.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class EventModelData + { + internal static EventModelData DeserializeEventModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EventModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EventModelProperties.DeserializeEventModelProperties(property.Value); + 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; + } + } + return new EventModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.Serialization.cs new file mode 100644 index 000000000000..8210b5dc6b98 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class EventModelProperties + { + internal static EventModelProperties DeserializeEventModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional resourceType = default; + Optional resourceName = default; + Optional eventType = default; + Optional eventName = default; + Optional timeOfOccurrence = default; + Optional severity = default; + Optional description = default; + Optional correlationId = default; + Optional> healthErrors = default; + EventModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventType"u8)) + { + eventType = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventName"u8)) + { + eventName = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfOccurrence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfOccurrence = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = 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(HealthErrorModel.DeserializeHealthErrorModel(item)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = EventModelCustomProperties.DeserializeEventModelCustomProperties(property.Value); + continue; + } + } + return new EventModelProperties(resourceType.Value, resourceName.Value, eventType.Value, eventName.Value, Optional.ToNullable(timeOfOccurrence), severity.Value, description.Value, correlationId.Value, Optional.ToList(healthErrors), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.cs new file mode 100644 index 000000000000..baf657a03df7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/EventModelProperties.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.Recoveryservicesdatareplication.Models +{ + /// Event model properties. + public partial class EventModelProperties + { + /// Initializes a new instance of EventModelProperties. + /// + /// Event model custom properties. + /// 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. + internal EventModelProperties(EventModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of EventModelProperties. + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// 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 . + /// + internal EventModelProperties(string resourceType, string resourceName, string eventType, string eventName, DateTimeOffset? timeOfOccurrence, string severity, string description, string correlationId, IReadOnlyList healthErrors, EventModelCustomProperties customProperties) + { + ResourceType = resourceType; + ResourceName = resourceName; + EventType = eventType; + EventName = eventName; + TimeOfOccurrence = timeOfOccurrence; + Severity = severity; + Description = description; + CorrelationId = correlationId; + HealthErrors = healthErrors; + CustomProperties = customProperties; + } + + /// Gets or sets the resource type. + public string ResourceType { get; } + /// Gets or sets the resource name. + public string ResourceName { get; } + /// Gets or sets the event type. + public string EventType { get; } + /// Gets or sets the event name. + public string EventName { get; } + /// Gets or sets the time at which the event occurred at source. + public DateTimeOffset? TimeOfOccurrence { get; } + /// Gets or sets the event severity. + public string Severity { get; } + /// Gets or sets the event description. + public string Description { get; } + /// Gets or sets the event correlation Id. + public string CorrelationId { get; } + /// Gets or sets the errors associated with this event. + public IReadOnlyList HealthErrors { get; } + /// + /// Event model custom properties. + /// 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 EventModelCustomProperties CustomProperties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.Serialization.cs new file mode 100644 index 000000000000..67880d4a065c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class FabricModelCollection + { + internal static FabricModelCollection DeserializeFabricModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(FabricModelData.DeserializeFabricModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new FabricModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.cs new file mode 100644 index 000000000000..937f690e9d11 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Fabric model collection. + internal partial class FabricModelCollection + { + /// Initializes a new instance of FabricModelCollection. + internal FabricModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of FabricModelCollection. + /// Gets or sets the list of fabrics. + /// Gets or sets the value of next link. + internal FabricModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of fabrics. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..13ae3d2f5a41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class FabricModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static FabricModelCustomProperties DeserializeFabricModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzStackHCI": return AzStackHCIFabricModelCustomProperties.DeserializeAzStackHCIFabricModelCustomProperties(element); + case "HyperVMigrate": return HyperVMigrateFabricModelCustomProperties.DeserializeHyperVMigrateFabricModelCustomProperties(element); + case "VMwareMigrate": return VMwareMigrateFabricModelCustomProperties.DeserializeVMwareMigrateFabricModelCustomProperties(element); + } + } + return UnknownFabricModelCustomProperties.DeserializeUnknownFabricModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.cs new file mode 100644 index 000000000000..f3b6e93a425e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class FabricModelCustomProperties + { + /// Initializes a new instance of FabricModelCustomProperties. + protected FabricModelCustomProperties() + { + } + + /// Initializes a new instance of FabricModelCustomProperties. + /// Gets or sets the instance type. + internal FabricModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelData.Serialization.cs new file mode 100644 index 000000000000..33289df1eba2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelData.Serialization.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class FabricModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WriteEndObject(); + } + + internal static FabricModelData DeserializeFabricModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FabricModelProperties properties = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = FabricModelProperties.DeserializeFabricModelProperties(property.Value); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new FabricModelData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.Serialization.cs new file mode 100644 index 000000000000..248a0bda22be --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class FabricModelPatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.cs new file mode 100644 index 000000000000..1c56b8b04468 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelPatch.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Fabric model for update. + public partial class FabricModelPatch : ResourceData + { + /// Initializes a new instance of FabricModelPatch. + public FabricModelPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Fabric model properties. + public FabricModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.Serialization.cs new file mode 100644 index 000000000000..cbe59ae601e9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class FabricModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static FabricModelProperties DeserializeFabricModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provisioningState = default; + Optional serviceEndpoint = default; + Optional serviceResourceId = default; + Optional health = default; + Optional> healthErrors = default; + FabricModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceEndpoint"u8)) + { + serviceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + serviceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new HealthStatus(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(HealthErrorModel.DeserializeHealthErrorModel(item)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = FabricModelCustomProperties.DeserializeFabricModelCustomProperties(property.Value); + continue; + } + } + return new FabricModelProperties(Optional.ToNullable(provisioningState), serviceEndpoint.Value, serviceResourceId.Value, Optional.ToNullable(health), Optional.ToList(healthErrors), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.cs new file mode 100644 index 000000000000..251f0ad652df --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FabricModelProperties.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; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Fabric model properties. + public partial class FabricModelProperties + { + /// Initializes a new instance of FabricModelProperties. + /// + /// Fabric model custom properties. + /// 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 . + /// + /// is null. + public FabricModelProperties(FabricModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of FabricModelProperties. + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// 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 . + /// + internal FabricModelProperties(ProvisioningState? provisioningState, string serviceEndpoint, string serviceResourceId, HealthStatus? health, IReadOnlyList healthErrors, FabricModelCustomProperties customProperties) + { + ProvisioningState = provisioningState; + ServiceEndpoint = serviceEndpoint; + ServiceResourceId = serviceResourceId; + Health = health; + HealthErrors = healthErrors; + CustomProperties = customProperties; + } + + /// Gets or sets the provisioning state of the fabric. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the service endpoint. + public string ServiceEndpoint { get; } + /// Gets or sets the service resource Id. + public string ServiceResourceId { get; } + /// Gets or sets the fabric health. + public HealthStatus? Health { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public FabricModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs new file mode 100644 index 000000000000..68c6631fadb6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class FailoverProtectedItemProperties + { + internal static FailoverProtectedItemProperties DeserializeFailoverProtectedItemProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional protectedItemName = default; + Optional vmName = default; + Optional testVmName = default; + Optional recoveryPointId = default; + Optional recoveryPointTime = default; + Optional networkName = default; + Optional subnet = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemName"u8)) + { + protectedItemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testVmName"u8)) + { + testVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointId"u8)) + { + recoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + } + return new FailoverProtectedItemProperties(protectedItemName.Value, vmName.Value, testVmName.Value, recoveryPointId.Value, Optional.ToNullable(recoveryPointTime), networkName.Value, subnet.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.cs new file mode 100644 index 000000000000..cc26f419dda9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverProtectedItemProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Failover properties of the protected item. + public partial class FailoverProtectedItemProperties + { + /// Initializes a new instance of FailoverProtectedItemProperties. + internal FailoverProtectedItemProperties() + { + } + + /// Initializes a new instance of FailoverProtectedItemProperties. + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + internal FailoverProtectedItemProperties(string protectedItemName, string vmName, string testVmName, string recoveryPointId, DateTimeOffset? recoveryPointOn, string networkName, string subnet) + { + ProtectedItemName = protectedItemName; + VmName = vmName; + TestVmName = testVmName; + RecoveryPointId = recoveryPointId; + RecoveryPointOn = recoveryPointOn; + NetworkName = networkName; + Subnet = subnet; + } + + /// Gets or sets the protected item name. + public string ProtectedItemName { get; } + /// Gets or sets the VM name. + public string VmName { get; } + /// Gets or sets the test VM name. + public string TestVmName { get; } + /// Gets or sets the recovery point Id. + public string RecoveryPointId { get; } + /// Gets or sets the recovery point time. + public DateTimeOffset? RecoveryPointOn { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the network subnet. + public string Subnet { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..82622e96c22e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class FailoverWorkflowModelCustomProperties + { + internal static FailoverWorkflowModelCustomProperties DeserializeFailoverWorkflowModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> protectedItemDetails = default; + string instanceType = default; + Optional> affectedObjectDetails = default; + 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(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item)); + } + 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; + } + } + return new FailoverWorkflowModelCustomProperties(instanceType, Optional.ToDictionary(affectedObjectDetails), Optional.ToList(protectedItemDetails)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.cs new file mode 100644 index 000000000000..f05e8e49068c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/FailoverWorkflowModelCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Failover workflow model custom properties. + public partial class FailoverWorkflowModelCustomProperties : WorkflowModelCustomProperties + { + /// Initializes a new instance of FailoverWorkflowModelCustomProperties. + internal FailoverWorkflowModelCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "FailoverWorkflowDetails"; + } + + /// Initializes a new instance of FailoverWorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the failed over protected item details. + internal FailoverWorkflowModelCustomProperties(string instanceType, IReadOnlyDictionary affectedObjectDetails, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "FailoverWorkflowDetails"; + } + + /// Gets or sets the failed over protected item details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.Serialization.cs new file mode 100644 index 000000000000..044c11a0412b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HealthErrorModel + { + internal static HealthErrorModel DeserializeHealthErrorModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional affectedResourceType = default; + Optional> affectedResourceCorrelationIds = default; + Optional> childErrors = default; + Optional code = default; + Optional healthCategory = default; + Optional category = default; + Optional severity = default; + Optional source = default; + Optional creationTime = default; + Optional isCustomerResolvable = default; + Optional summary = default; + Optional message = default; + Optional causes = default; + Optional recommendation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affectedResourceType"u8)) + { + affectedResourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedResourceCorrelationIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + affectedResourceCorrelationIds = array; + continue; + } + if (property.NameEquals("childErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(InnerHealthErrorModel.DeserializeInnerHealthErrorModel(item)); + } + childErrors = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + } + return new HealthErrorModel(affectedResourceType.Value, Optional.ToList(affectedResourceCorrelationIds), Optional.ToList(childErrors), code.Value, healthCategory.Value, category.Value, severity.Value, source.Value, Optional.ToNullable(creationTime), Optional.ToNullable(isCustomerResolvable), summary.Value, message.Value, causes.Value, recommendation.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.cs new file mode 100644 index 000000000000..af598e4d61fa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthErrorModel.cs @@ -0,0 +1,94 @@ +// 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.Recoveryservicesdatareplication.Models +{ + /// Health error model. + public partial class HealthErrorModel + { + /// Initializes a new instance of HealthErrorModel. + internal HealthErrorModel() + { + AffectedResourceCorrelationIds = new ChangeTrackingList(); + ChildErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of HealthErrorModel. + /// Gets or sets the type of affected resource type. + /// + /// Gets or sets the list of affected resource correlation Ids. This can be used to + /// uniquely identify the count of items affected by a specific category and severity + /// as well as count of item affected by an specific issue. + /// + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + internal HealthErrorModel(string affectedResourceType, IReadOnlyList affectedResourceCorrelationIds, IReadOnlyList childErrors, string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation) + { + AffectedResourceType = affectedResourceType; + AffectedResourceCorrelationIds = affectedResourceCorrelationIds; + ChildErrors = childErrors; + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + } + + /// Gets or sets the type of affected resource type. + public string AffectedResourceType { get; } + /// + /// Gets or sets the list of affected resource correlation Ids. This can be used to + /// uniquely identify the count of items affected by a specific category and severity + /// as well as count of item affected by an specific issue. + /// + public IReadOnlyList AffectedResourceCorrelationIds { get; } + /// Gets or sets a list of child health errors associated with this error. + public IReadOnlyList ChildErrors { get; } + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthStatus.cs new file mode 100644 index 000000000000..dee49689f151 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HealthStatus.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the fabric health. + public readonly partial struct HealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NormalValue = "Normal"; + private const string WarningValue = "Warning"; + private const string CriticalValue = "Critical"; + + /// Normal. + public static HealthStatus Normal { get; } = new HealthStatus(NormalValue); + /// Warning. + public static HealthStatus Warning { get; } = new HealthStatus(WarningValue); + /// Critical. + public static HealthStatus Critical { get; } = new HealthStatus(CriticalValue); + /// Determines if two values are the same. + public static bool operator ==(HealthStatus left, HealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HealthStatus left, HealthStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator HealthStatus(string value) => new HealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HealthStatus other && Equals(other); + /// + public bool Equals(HealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c7c16b564123 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVMigrateFabricModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static HyperVMigrateFabricModelCustomProperties DeserializeHyperVMigrateFabricModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hyperVSiteId = default; + Optional fabricResourceId = default; + Optional fabricContainerId = default; + string migrationSolutionId = default; + Optional migrationHubUri = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + fabricResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + fabricContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationHubUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVMigrateFabricModelCustomProperties(instanceType, hyperVSiteId, fabricResourceId.Value, fabricContainerId.Value, migrationSolutionId, migrationHubUri.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs new file mode 100644 index 000000000000..afc5cd4042c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVMigrateFabricModelCustomProperties.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV migrate fabric model custom properties. + public partial class HyperVMigrateFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of HyperVMigrateFabricModelCustomProperties. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the migration solution ARM Id. + /// or is null. + public HyperVMigrateFabricModelCustomProperties(string hyperVSiteId, string migrationSolutionId) + { + Argument.AssertNotNull(hyperVSiteId, nameof(hyperVSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + HyperVSiteId = hyperVSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "HyperVMigrate"; + } + + /// Initializes a new instance of HyperVMigrateFabricModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal HyperVMigrateFabricModelCustomProperties(string instanceType, string hyperVSiteId, string fabricResourceId, string fabricContainerId, string migrationSolutionId, Uri migrationHubUri) : base(instanceType) + { + HyperVSiteId = hyperVSiteId; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "HyperVMigrate"; + } + + /// Gets or sets the ARM Id of the HyperV site. + public string HyperVSiteId { get; set; } + /// Gets or sets the fabric resource Id. + public string FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public string FabricContainerId { get; } + /// Gets or sets the migration solution ARM Id. + public string MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public Uri MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs new file mode 100644 index 000000000000..4529dedb394b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIDiskInput : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCIDiskInput DeserializeHyperVToAzStackHCIDiskInput(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + Optional storageContainerId = default; + Optional isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + } + return new HyperVToAzStackHCIDiskInput(diskId, storageContainerId.Value, Optional.ToNullable(isDynamic), diskSizeGB, diskFileFormat, isOSDisk); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs new file mode 100644 index 000000000000..0762e8aba457 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIDiskInput.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperVToAzStack disk input. + public partial class HyperVToAzStackHCIDiskInput + { + /// Initializes a new instance of HyperVToAzStackHCIDiskInput. + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public HyperVToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of HyperVToAzStackHCIDiskInput. + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + internal HyperVToAzStackHCIDiskInput(string diskId, string storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public string StorageContainerId { get; set; } + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..527d37f42fcc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIEventModelCustomProperties + { + internal static HyperVToAzStackHCIEventModelCustomProperties DeserializeHyperVToAzStackHCIEventModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional eventSourceFriendlyName = default; + Optional protectedItemFriendlyName = default; + Optional sourceApplianceName = default; + Optional targetApplianceName = default; + Optional serverType = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eventSourceFriendlyName"u8)) + { + eventSourceFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemFriendlyName"u8)) + { + protectedItemFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverType"u8)) + { + serverType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIEventModelCustomProperties(instanceType, eventSourceFriendlyName.Value, protectedItemFriendlyName.Value, sourceApplianceName.Value, targetApplianceName.Value, serverType.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs new file mode 100644 index 000000000000..3d1d2694fe60 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIEventModelCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// HyperV to AzStackHCI event model custom properties. This class provides provider specific + /// details for events of type DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and + /// DataContract.HealthEvents.HealthEventType.AgentHealth. + /// + public partial class HyperVToAzStackHCIEventModelCustomProperties : EventModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIEventModelCustomProperties. + internal HyperVToAzStackHCIEventModelCustomProperties() + { + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIEventModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + internal HyperVToAzStackHCIEventModelCustomProperties(string instanceType, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the friendly name of the source which has raised this health event. + public string EventSourceFriendlyName { get; } + /// Gets or sets the protected item friendly name. + public string ProtectedItemFriendlyName { get; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the source target name. + public string TargetApplianceName { get; } + /// Gets or sets the server type. + public string ServerType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs new file mode 100644 index 000000000000..6c5065a873d5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCINicInput : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCINicInput DeserializeHyperVToAzStackHCINicInput(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + Optional networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + } + return new HyperVToAzStackHCINicInput(nicId, networkName.Value, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs new file mode 100644 index 000000000000..bebeac94002e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCINicInput.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHCINicInput + { + /// Initializes a new instance of HyperVToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// , or is null. + public HyperVToAzStackHCINicInput(string nicId, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + Argument.AssertNotNull(targetNetworkId, nameof(targetNetworkId)); + Argument.AssertNotNull(testNetworkId, nameof(testNetworkId)); + + NicId = nicId; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of HyperVToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + internal HyperVToAzStackHCINicInput(string nicId, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover) + { + NicId = nicId; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..db9b366499a3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCIPlannedFailoverModelCustomProperties DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIPlannedFailoverModelCustomProperties(instanceType, shutdownSourceVm); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..2fb804019f5a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV to AzStackHCI planned failover model custom properties. + public partial class HyperVToAzStackHCIPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIPlannedFailoverModelCustomProperties. + /// Gets or sets a value indicating whether VM needs to be shut down. + public HyperVToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIPlannedFailoverModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal HyperVToAzStackHCIPlannedFailoverModelCustomProperties(string instanceType, bool shutdownSourceVm) : base(instanceType) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..95ee574eb8e2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCIPolicyModelCustomProperties DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIPolicyModelCustomProperties(instanceType, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..fe0c65237760 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIPolicyModelCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV To AzStackHCI Policy model custom properties. + public partial class HyperVToAzStackHCIPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIPolicyModelCustomProperties. + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public HyperVToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIPolicyModelCustomProperties. + /// Gets or sets the instance type. + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal HyperVToAzStackHCIPolicyModelCustomProperties(string instanceType, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..9901d3606a14 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIProtectedDiskProperties + { + internal static HyperVToAzStackHCIProtectedDiskProperties DeserializeHyperVToAzStackHCIProtectedDiskProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional storageContainerId = default; + Optional storageContainerLocalPath = default; + Optional sourceDiskId = default; + Optional sourceDiskName = default; + Optional seedDiskName = default; + Optional testMigrateDiskName = default; + Optional migrateDiskName = default; + Optional isOSDisk = default; + Optional capacityInBytes = default; + Optional isDynamic = default; + Optional diskType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIProtectedDiskProperties(storageContainerId.Value, storageContainerLocalPath.Value, sourceDiskId.Value, sourceDiskName.Value, seedDiskName.Value, testMigrateDiskName.Value, migrateDiskName.Value, Optional.ToNullable(isOSDisk), Optional.ToNullable(capacityInBytes), Optional.ToNullable(isDynamic), diskType.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs new file mode 100644 index 000000000000..47e2a7988ae7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedDiskProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperVToAzStackHCI protected disk properties. + public partial class HyperVToAzStackHCIProtectedDiskProperties + { + /// Initializes a new instance of HyperVToAzStackHCIProtectedDiskProperties. + internal HyperVToAzStackHCIProtectedDiskProperties() + { + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedDiskProperties. + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk type. + internal HyperVToAzStackHCIProtectedDiskProperties(string storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + } + + /// Gets or sets the ARM Id of the storage container. + public string StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..35be60be07f3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceDraName"u8); + writer.WriteStringValue(SourceDraName); + writer.WritePropertyName("targetDraName"u8); + writer.WriteStringValue(TargetDraName); + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCIProtectedItemModelCustomProperties DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional activeLocation = default; + string targetHciClusterId = default; + string targetArcClusterCustomLocationId = default; + Optional targetAzStackHciClusterName = default; + string fabricDiscoveryMachineId = default; + IList disksToInclude = default; + IList nicsToInclude = default; + Optional sourceVmName = default; + Optional sourceCpuCores = default; + Optional sourceMemoryInMegaBytes = default; + Optional targetVmName = default; + string targetResourceGroupId = default; + string storageContainerId = default; + string hyperVGeneration = default; + Optional targetNetworkId = default; + Optional testNetworkId = default; + Optional targetCpuCores = default; + Optional isDynamicRam = default; + Optional dynamicMemoryConfig = default; + Optional targetMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceDraName = default; + string targetDraName = default; + Optional sourceApplianceName = default; + Optional targetApplianceName = default; + Optional osType = default; + Optional osName = default; + Optional firmwareType = default; + Optional targetLocation = default; + string customLocationRegion = default; + Optional failoverRecoveryPointId = default; + Optional lastRecoveryPointReceived = default; + Optional lastRecoveryPointId = default; + Optional initialReplicationProgressPercentage = default; + Optional resyncProgressPercentage = default; + Optional> protectedDisks = default; + Optional> protectedNics = default; + Optional targetVmBiosId = default; + Optional lastReplicationUpdateTime = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIDiskInput.DeserializeHyperVToAzStackHCIDiskInput(item)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCINicInput.DeserializeHyperVToAzStackHCINicInput(item)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDraName"u8)) + { + sourceDraName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetDraName"u8)) + { + targetDraName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIProtectedDiskProperties.DeserializeHyperVToAzStackHCIProtectedDiskProperties(item)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHCIProtectedNicProperties.DeserializeHyperVToAzStackHCIProtectedNicProperties(item)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIProtectedItemModelCustomProperties(instanceType, Optional.ToNullable(activeLocation), targetHciClusterId, targetArcClusterCustomLocationId, targetAzStackHciClusterName.Value, fabricDiscoveryMachineId, disksToInclude, nicsToInclude, sourceVmName.Value, Optional.ToNullable(sourceCpuCores), Optional.ToNullable(sourceMemoryInMegaBytes), targetVmName.Value, targetResourceGroupId, storageContainerId, hyperVGeneration, targetNetworkId.Value, testNetworkId.Value, Optional.ToNullable(targetCpuCores), Optional.ToNullable(isDynamicRam), dynamicMemoryConfig.Value, Optional.ToNullable(targetMemoryInMegaBytes), runAsAccountId, sourceDraName, targetDraName, sourceApplianceName.Value, targetApplianceName.Value, osType.Value, osName.Value, firmwareType.Value, targetLocation.Value, customLocationRegion, failoverRecoveryPointId.Value, Optional.ToNullable(lastRecoveryPointReceived), lastRecoveryPointId.Value, Optional.ToNullable(initialReplicationProgressPercentage), Optional.ToNullable(resyncProgressPercentage), Optional.ToList(protectedDisks), Optional.ToList(protectedNics), targetVmBiosId.Value, Optional.ToNullable(lastReplicationUpdateTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..0dad0b84bdbe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedItemModelCustomProperties.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHCIProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the Run As account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// , , , , , , , , , , or is null. + public HyperVToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string fabricDiscoveryMachineId, IEnumerable disksToInclude, IEnumerable nicsToInclude, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceDraName, string targetDraName, string customLocationRegion) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceDraName, nameof(sourceDraName)); + Argument.AssertNotNull(targetDraName, nameof(targetDraName)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + RunAsAccountId = runAsAccountId; + SourceDraName = sourceDraName; + TargetDraName = targetDraName; + CustomLocationRegion = customLocationRegion; + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + internal HyperVToAzStackHCIProtectedItemModelCustomProperties(string instanceType, ProtectedItemActiveLocation? activeLocation, string targetHciClusterId, string targetArcClusterCustomLocationId, string targetAzStackHciClusterName, string fabricDiscoveryMachineId, IList disksToInclude, IList nicsToInclude, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string targetVmName, string targetResourceGroupId, string storageContainerId, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string runAsAccountId, string sourceDraName, string targetDraName, string sourceApplianceName, string targetApplianceName, string osType, string osName, string firmwareType, string targetLocation, string customLocationRegion, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? resyncProgressPercentage, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + TargetVmName = targetVmName; + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceDraName = sourceDraName; + TargetDraName = targetDraName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceived = lastRecoveryPointReceived; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public string TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public string TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the ARM Id of the discovered machine. + public string FabricDiscoveryMachineId { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the target resource group ARM Id. + public string TargetResourceGroupId { get; set; } + /// Gets or sets the target storage container ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the Run As account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source DRA name. + public string SourceDraName { get; set; } + /// Gets or sets the target DRA name. + public string TargetDraName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceived { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + public int? InitialReplicationProgressPercentage { get; } + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + public int? ResyncProgressPercentage { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..6dc8b4e902b5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.Serialization.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIProtectedNicProperties + { + internal static HyperVToAzStackHCIProtectedNicProperties DeserializeHyperVToAzStackHCIProtectedNicProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nicId = default; + Optional macAddress = default; + Optional networkName = default; + Optional targetNetworkId = default; + Optional testNetworkId = default; + Optional selectionTypeForFailover = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + } + return new HyperVToAzStackHCIProtectedNicProperties(nicId.Value, macAddress.Value, networkName.Value, targetNetworkId.Value, testNetworkId.Value, Optional.ToNullable(selectionTypeForFailover)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs new file mode 100644 index 000000000000..f985c1fb59bf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIProtectedNicProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHCIProtectedNicProperties + { + /// Initializes a new instance of HyperVToAzStackHCIProtectedNicProperties. + internal HyperVToAzStackHCIProtectedNicProperties() + { + } + + /// Initializes a new instance of HyperVToAzStackHCIProtectedNicProperties. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + internal HyperVToAzStackHCIProtectedNicProperties(string nicId, string macAddress, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover) + { + NicId = nicId; + MacAddress = macAddress; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..56a39b323d36 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties + { + internal static HyperVToAzStackHCIRecoveryPointModelCustomProperties DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> diskIds = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + diskIds = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIRecoveryPointModelCustomProperties(instanceType, Optional.ToList(diskIds)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..cbfe7fdfdf5a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIRecoveryPointModelCustomProperties.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV to AzStackHCI recovery point model custom properties. + public partial class HyperVToAzStackHCIRecoveryPointModelCustomProperties : RecoveryPointModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIRecoveryPointModelCustomProperties. + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIRecoveryPointModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the list of the disk Ids. + internal HyperVToAzStackHCIRecoveryPointModelCustomProperties(string instanceType, IReadOnlyList diskIds) : base(instanceType) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ad9ac523ebe9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("hyperVFabricArmId"u8); + writer.WriteStringValue(HyperVFabricArmId); + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static HyperVToAzStackHCIReplicationExtensionModelCustomProperties DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hyperVFabricArmId = default; + Optional hyperVSiteId = default; + string azStackHciFabricArmId = default; + Optional azStackHciSiteId = default; + Optional storageAccountId = default; + Optional storageAccountSasSecretName = default; + Optional asrServiceUri = default; + Optional rcmServiceUri = default; + Optional gatewayServiceUri = default; + Optional sourceGatewayServiceId = default; + Optional targetGatewayServiceId = default; + Optional sourceStorageContainerName = default; + Optional targetStorageContainerName = default; + Optional resourceLocation = default; + Optional subscriptionId = default; + Optional resourceGroup = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVFabricArmId"u8)) + { + hyperVFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asrServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rcmServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new HyperVToAzStackHCIReplicationExtensionModelCustomProperties(instanceType, hyperVFabricArmId, hyperVSiteId.Value, azStackHciFabricArmId, azStackHciSiteId.Value, storageAccountId.Value, storageAccountSasSecretName.Value, asrServiceUri.Value, rcmServiceUri.Value, gatewayServiceUri.Value, sourceGatewayServiceId.Value, targetGatewayServiceId.Value, sourceStorageContainerName.Value, targetStorageContainerName.Value, resourceLocation.Value, subscriptionId.Value, resourceGroup.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..621f6a05392c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/HyperVToAzStackHCIReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// HyperV to AzStackHCI Replication extension model custom properties. + public partial class HyperVToAzStackHCIReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of HyperVToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string hyperVFabricArmId, string azStackHciFabricArmId) + { + Argument.AssertNotNull(hyperVFabricArmId, nameof(hyperVFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + HyperVFabricArmId = hyperVFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of HyperVToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal HyperVToAzStackHCIReplicationExtensionModelCustomProperties(string instanceType, string hyperVFabricArmId, string hyperVSiteId, string azStackHciFabricArmId, string azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, Uri asrServiceUri, Uri rcmServiceUri, Uri gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType) + { + HyperVFabricArmId = hyperVFabricArmId; + HyperVSiteId = hyperVSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the ARM Id of the source HyperV fabric. + public string HyperVFabricArmId { get; set; } + /// Gets or sets the ARM Id of the HyperV site. + public string HyperVSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public string AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public Uri AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public Uri RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public Uri GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.Serialization.cs new file mode 100644 index 000000000000..f2d2889fc202 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class IdentityModel : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + writer.WritePropertyName("aadAuthority"u8); + writer.WriteStringValue(AadAuthority); + writer.WriteEndObject(); + } + + internal static IdentityModel DeserializeIdentityModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid tenantId = default; + string applicationId = default; + string objectId = default; + string audience = default; + string aadAuthority = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (property.NameEquals("aadAuthority"u8)) + { + aadAuthority = property.Value.GetString(); + continue; + } + } + return new IdentityModel(tenantId, applicationId, objectId, audience, aadAuthority); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.cs new file mode 100644 index 000000000000..a1352fc07e6c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/IdentityModel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Identity model. + public partial class IdentityModel + { + /// Initializes a new instance of IdentityModel. + /// Gets or sets the tenant Id of the SPN with which Dra communicates to service. + /// + /// Gets or sets the client/application Id of the SPN with which Dra communicates to + /// service. + /// + /// Gets or sets the object Id of the SPN with which Dra communicates to service. + /// Gets or sets the audience of the SPN with which Dra communicates to service. + /// Gets or sets the authority of the SPN with which Dra communicates to service. + /// , , or is null. + public IdentityModel(Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority) + { + Argument.AssertNotNull(applicationId, nameof(applicationId)); + Argument.AssertNotNull(objectId, nameof(objectId)); + Argument.AssertNotNull(audience, nameof(audience)); + Argument.AssertNotNull(aadAuthority, nameof(aadAuthority)); + + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + } + + /// Gets or sets the tenant Id of the SPN with which Dra communicates to service. + public Guid TenantId { get; set; } + /// + /// Gets or sets the client/application Id of the SPN with which Dra communicates to + /// service. + /// + public string ApplicationId { get; set; } + /// Gets or sets the object Id of the SPN with which Dra communicates to service. + public string ObjectId { get; set; } + /// Gets or sets the audience of the SPN with which Dra communicates to service. + public string Audience { get; set; } + /// Gets or sets the authority of the SPN with which Dra communicates to service. + public string AadAuthority { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs new file mode 100644 index 000000000000..d6786caf3584 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.Serialization.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class InnerHealthErrorModel + { + internal static InnerHealthErrorModel DeserializeInnerHealthErrorModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional healthCategory = default; + Optional category = default; + Optional severity = default; + Optional source = default; + Optional creationTime = default; + Optional isCustomerResolvable = default; + Optional summary = default; + Optional message = default; + Optional causes = default; + Optional recommendation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + } + return new InnerHealthErrorModel(code.Value, healthCategory.Value, category.Value, severity.Value, source.Value, Optional.ToNullable(creationTime), Optional.ToNullable(isCustomerResolvable), summary.Value, message.Value, causes.Value, recommendation.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.cs new file mode 100644 index 000000000000..c40a2b5c2e00 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/InnerHealthErrorModel.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Inner health error model. + public partial class InnerHealthErrorModel + { + /// Initializes a new instance of InnerHealthErrorModel. + internal InnerHealthErrorModel() + { + } + + /// Initializes a new instance of InnerHealthErrorModel. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + internal InnerHealthErrorModel(string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation) + { + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.Serialization.cs new file mode 100644 index 000000000000..d9ac425eb95d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class OperationStatus + { + internal static OperationStatus DeserializeOperationStatus(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional name = default; + Optional status = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetString(); + continue; + } + } + return new OperationStatus(id.Value, name.Value, status.Value, startTime.Value, endTime.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..b3163de9941f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/OperationStatus.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Defines the operation status. + public partial class OperationStatus + { + /// Initializes a new instance of OperationStatus. + internal OperationStatus() + { + } + + /// Initializes a new instance of OperationStatus. + /// Gets or sets the Id. + /// Gets or sets the operation name. + /// + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of + /// Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + /// + /// Gets or sets the start time. + /// Gets or sets the end time. + internal OperationStatus(string id, string name, string status, string startTime, string endTime) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + EndTime = endTime; + } + + /// Gets or sets the Id. + public string Id { get; } + /// Gets or sets the operation name. + public string Name { get; } + /// + /// Gets or sets the status of the operation. ARM expects the terminal status to be one of + /// Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. + /// + public string Status { get; } + /// Gets or sets the start time. + public string StartTime { get; } + /// Gets or sets the end time. + public string EndTime { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs new file mode 100644 index 000000000000..f381b35b870a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class PlannedFailoverModel : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static PlannedFailoverModel DeserializePlannedFailoverModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverModelProperties properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = PlannedFailoverModelProperties.DeserializePlannedFailoverModelProperties(property.Value); + continue; + } + } + return new PlannedFailoverModel(properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.cs new file mode 100644 index 000000000000..4d12ddf380bf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModel.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Planned failover model. + public partial class PlannedFailoverModel + { + /// Initializes a new instance of PlannedFailoverModel. + /// Planned failover model properties. + /// is null. + public PlannedFailoverModel(PlannedFailoverModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Planned failover model properties. + internal PlannedFailoverModelProperties Properties { get; set; } + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public PlannedFailoverModelCustomProperties PlannedFailoverModelCustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set => Properties = new PlannedFailoverModelProperties(value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..41dbc4292607 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class PlannedFailoverModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static PlannedFailoverModelCustomProperties DeserializePlannedFailoverModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIPlannedFailoverModelCustomProperties.DeserializeHyperVToAzStackHCIPlannedFailoverModelCustomProperties(element); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIPlannedFailoverModelCustomProperties.DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(element); + } + } + return UnknownPlannedFailoverModelCustomProperties.DeserializeUnknownPlannedFailoverModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..00f1a143262e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of PlannedFailoverModelCustomProperties. + protected PlannedFailoverModelCustomProperties() + { + } + + /// Initializes a new instance of PlannedFailoverModelCustomProperties. + /// Gets or sets the instance type. + internal PlannedFailoverModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs new file mode 100644 index 000000000000..ecf8b4da5ff1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class PlannedFailoverModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static PlannedFailoverModelProperties DeserializePlannedFailoverModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + customProperties = PlannedFailoverModelCustomProperties.DeserializePlannedFailoverModelCustomProperties(property.Value); + continue; + } + } + return new PlannedFailoverModelProperties(customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.cs new file mode 100644 index 000000000000..e58945a17389 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PlannedFailoverModelProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Planned failover model properties. + public partial class PlannedFailoverModelProperties + { + /// Initializes a new instance of PlannedFailoverModelProperties. + /// + /// Planned failover model custom properties. + /// 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 . + /// + /// is null. + public PlannedFailoverModelProperties(PlannedFailoverModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public PlannedFailoverModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.Serialization.cs new file mode 100644 index 000000000000..49574b689019 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class PolicyModelCollection + { + internal static PolicyModelCollection DeserializePolicyModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(PolicyModelData.DeserializePolicyModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PolicyModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.cs new file mode 100644 index 000000000000..167f7566e866 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Policy model collection. + internal partial class PolicyModelCollection + { + /// Initializes a new instance of PolicyModelCollection. + internal PolicyModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PolicyModelCollection. + /// Gets or sets the list of policies. + /// Gets or sets the value of next link. + internal PolicyModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of policies. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..fda8c9a3ffa1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class PolicyModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static PolicyModelCustomProperties DeserializePolicyModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIPolicyModelCustomProperties.DeserializeHyperVToAzStackHCIPolicyModelCustomProperties(element); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIPolicyModelCustomProperties.DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(element); + } + } + return UnknownPolicyModelCustomProperties.DeserializeUnknownPolicyModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.cs new file mode 100644 index 000000000000..dd4b782e87fb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class PolicyModelCustomProperties + { + /// Initializes a new instance of PolicyModelCustomProperties. + protected PolicyModelCustomProperties() + { + } + + /// Initializes a new instance of PolicyModelCustomProperties. + /// Gets or sets the instance type. + internal PolicyModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelData.Serialization.cs new file mode 100644 index 000000000000..f79550e1b5e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelData.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class PolicyModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static PolicyModelData DeserializePolicyModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PolicyModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = PolicyModelProperties.DeserializePolicyModelProperties(property.Value); + 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; + } + } + return new PolicyModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.Serialization.cs new file mode 100644 index 000000000000..6158f47a721a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class PolicyModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static PolicyModelProperties DeserializePolicyModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provisioningState = default; + PolicyModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = PolicyModelCustomProperties.DeserializePolicyModelCustomProperties(property.Value); + continue; + } + } + return new PolicyModelProperties(Optional.ToNullable(provisioningState), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.cs new file mode 100644 index 000000000000..82bc2ef754f1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/PolicyModelProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Policy model properties. + public partial class PolicyModelProperties + { + /// Initializes a new instance of PolicyModelProperties. + /// + /// Policy model custom properties. + /// 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 . + /// + /// is null. + public PolicyModelProperties(PolicyModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of PolicyModelProperties. + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// 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 . + /// + internal PolicyModelProperties(ProvisioningState? provisioningState, PolicyModelCustomProperties customProperties) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + } + + /// Gets or sets the provisioning state of the policy. + public ProvisioningState? ProvisioningState { get; } + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public PolicyModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemActiveLocation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemActiveLocation.cs new file mode 100644 index 000000000000..9966cbee36ae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemActiveLocation.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the location of the protected item. + public readonly partial struct ProtectedItemActiveLocation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtectedItemActiveLocation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string RecoveryValue = "Recovery"; + + /// Primary. + public static ProtectedItemActiveLocation Primary { get; } = new ProtectedItemActiveLocation(PrimaryValue); + /// Recovery. + public static ProtectedItemActiveLocation Recovery { get; } = new ProtectedItemActiveLocation(RecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProtectedItemActiveLocation(string value) => new ProtectedItemActiveLocation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtectedItemActiveLocation other && Equals(other); + /// + public bool Equals(ProtectedItemActiveLocation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs new file mode 100644 index 000000000000..3a483d9e72b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemDynamicMemoryConfig : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("maximumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MaximumMemoryInMegaBytes); + writer.WritePropertyName("minimumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MinimumMemoryInMegaBytes); + writer.WritePropertyName("targetMemoryBufferPercentage"u8); + writer.WriteNumberValue(TargetMemoryBufferPercentage); + writer.WriteEndObject(); + } + + internal static ProtectedItemDynamicMemoryConfig DeserializeProtectedItemDynamicMemoryConfig(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long maximumMemoryInMegaBytes = default; + long minimumMemoryInMegaBytes = default; + int targetMemoryBufferPercentage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumMemoryInMegaBytes"u8)) + { + maximumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("minimumMemoryInMegaBytes"u8)) + { + minimumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("targetMemoryBufferPercentage"u8)) + { + targetMemoryBufferPercentage = property.Value.GetInt32(); + continue; + } + } + return new ProtectedItemDynamicMemoryConfig(maximumMemoryInMegaBytes, minimumMemoryInMegaBytes, targetMemoryBufferPercentage); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs new file mode 100644 index 000000000000..a4d0f0f20030 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Protected item dynamic memory config. + public partial class ProtectedItemDynamicMemoryConfig + { + /// Initializes a new instance of ProtectedItemDynamicMemoryConfig. + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + } + + /// Gets or sets maximum memory in MB. + public long MaximumMemoryInMegaBytes { get; set; } + /// Gets or sets minimum memory in MB. + public long MinimumMemoryInMegaBytes { get; set; } + /// Gets or sets target memory buffer in %. + public int TargetMemoryBufferPercentage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs new file mode 100644 index 000000000000..ad1b936a6863 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemJobProperties + { + internal static ProtectedItemJobProperties DeserializeProtectedItemJobProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scenarioName = default; + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ProtectedItemJobProperties(scenarioName.Value, id.Value, name.Value, displayName.Value, state.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.cs new file mode 100644 index 000000000000..e2732318f8ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemJobProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Protected item job properties. + public partial class ProtectedItemJobProperties + { + /// Initializes a new instance of ProtectedItemJobProperties. + internal ProtectedItemJobProperties() + { + } + + /// Initializes a new instance of ProtectedItemJobProperties. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + internal ProtectedItemJobProperties(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn) + { + ScenarioName = scenarioName; + Id = id; + Name = name; + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + } + + /// Gets or sets protection scenario name. + public string ScenarioName { get; } + /// Gets or sets workflow Id. + public string Id { get; } + /// Gets or sets workflow name. + public string Name { get; } + /// Gets or sets the workflow friendly display name. + public string DisplayName { get; } + /// Gets or sets workflow state. + public string State { get; } + /// Gets or sets start time of the workflow. + public DateTimeOffset? StartOn { get; } + /// Gets or sets end time of the workflow. + public DateTimeOffset? EndOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.Serialization.cs new file mode 100644 index 000000000000..ed2548d5defd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class ProtectedItemModelCollection + { + internal static ProtectedItemModelCollection DeserializeProtectedItemModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(ProtectedItemModelData.DeserializeProtectedItemModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ProtectedItemModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.cs new file mode 100644 index 000000000000..52ea67ae7850 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Protected item model collection. + internal partial class ProtectedItemModelCollection + { + /// Initializes a new instance of ProtectedItemModelCollection. + internal ProtectedItemModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ProtectedItemModelCollection. + /// Gets or sets the list of protected items. + /// Gets or sets the value of next link. + internal ProtectedItemModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of protected items. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e6543a48c02b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static ProtectedItemModelCustomProperties DeserializeProtectedItemModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIProtectedItemModelCustomProperties.DeserializeHyperVToAzStackHCIProtectedItemModelCustomProperties(element); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIProtectedItemModelCustomProperties.DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(element); + } + } + return UnknownProtectedItemModelCustomProperties.DeserializeUnknownProtectedItemModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..ae10adf5f56b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class ProtectedItemModelCustomProperties + { + /// Initializes a new instance of ProtectedItemModelCustomProperties. + protected ProtectedItemModelCustomProperties() + { + } + + /// Initializes a new instance of ProtectedItemModelCustomProperties. + /// Gets or sets the instance type. + internal ProtectedItemModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelData.Serialization.cs new file mode 100644 index 000000000000..7570152c563a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelData.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class ProtectedItemModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static ProtectedItemModelData DeserializeProtectedItemModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ProtectedItemModelProperties.DeserializeProtectedItemModelProperties(property.Value); + 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; + } + } + return new ProtectedItemModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs new file mode 100644 index 000000000000..99dade7976a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.Serialization.cs @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("policyName"u8); + writer.WriteStringValue(PolicyName); + writer.WritePropertyName("replicationExtensionName"u8); + writer.WriteStringValue(ReplicationExtensionName); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static ProtectedItemModelProperties DeserializeProtectedItemModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string policyName = default; + string replicationExtensionName = default; + Optional correlationId = default; + Optional provisioningState = default; + Optional protectionState = default; + Optional protectionStateDescription = default; + Optional testFailoverState = default; + Optional testFailoverStateDescription = default; + Optional resynchronizationState = default; + Optional fabricObjectId = default; + Optional fabricObjectName = default; + Optional sourceFabricProviderId = default; + Optional targetFabricProviderId = default; + Optional fabricId = default; + Optional targetFabricId = default; + Optional draId = default; + Optional targetDraId = default; + Optional resyncRequired = default; + Optional lastSuccessfulPlannedFailoverTime = default; + Optional lastSuccessfulUnplannedFailoverTime = default; + Optional lastSuccessfulTestFailoverTime = default; + Optional currentJob = default; + Optional> allowedJobs = default; + Optional lastFailedEnableProtectionJob = default; + Optional lastFailedPlannedFailoverJob = default; + Optional lastTestFailoverJob = default; + Optional replicationHealth = default; + Optional> healthErrors = default; + ProtectedItemModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyName"u8)) + { + policyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("replicationExtensionName"u8)) + { + replicationExtensionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectionState = new ProtectionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionStateDescription"u8)) + { + protectionStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testFailoverState = new TestFailoverState(property.Value.GetString()); + continue; + } + if (property.NameEquals("testFailoverStateDescription"u8)) + { + testFailoverStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("resynchronizationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resynchronizationState = new ResynchronizationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricObjectId"u8)) + { + fabricObjectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricObjectName"u8)) + { + fabricObjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricId"u8)) + { + fabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricId"u8)) + { + targetFabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("draId"u8)) + { + draId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetDraId"u8)) + { + targetDraId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastSuccessfulPlannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulPlannedFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulUnplannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulUnplannedFailoverTime = 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("currentJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentJob = ProtectedItemModelPropertiesCurrentJob.DeserializeProtectedItemModelPropertiesCurrentJob(property.Value); + continue; + } + if (property.NameEquals("allowedJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedJobs = array; + continue; + } + if (property.NameEquals("lastFailedEnableProtectionJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedEnableProtectionJob = ProtectedItemModelPropertiesLastFailedEnableProtectionJob.DeserializeProtectedItemModelPropertiesLastFailedEnableProtectionJob(property.Value); + continue; + } + if (property.NameEquals("lastFailedPlannedFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedPlannedFailoverJob = ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.DeserializeProtectedItemModelPropertiesLastFailedPlannedFailoverJob(property.Value); + continue; + } + if (property.NameEquals("lastTestFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTestFailoverJob = ProtectedItemModelPropertiesLastTestFailoverJob.DeserializeProtectedItemModelPropertiesLastTestFailoverJob(property.Value); + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicationHealth = new HealthStatus(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(HealthErrorModel.DeserializeHealthErrorModel(item)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = ProtectedItemModelCustomProperties.DeserializeProtectedItemModelCustomProperties(property.Value); + continue; + } + } + return new ProtectedItemModelProperties(policyName, replicationExtensionName, correlationId.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(protectionState), protectionStateDescription.Value, Optional.ToNullable(testFailoverState), testFailoverStateDescription.Value, Optional.ToNullable(resynchronizationState), fabricObjectId.Value, fabricObjectName.Value, sourceFabricProviderId.Value, targetFabricProviderId.Value, fabricId.Value, targetFabricId.Value, draId.Value, targetDraId.Value, Optional.ToNullable(resyncRequired), Optional.ToNullable(lastSuccessfulPlannedFailoverTime), Optional.ToNullable(lastSuccessfulUnplannedFailoverTime), Optional.ToNullable(lastSuccessfulTestFailoverTime), currentJob.Value, Optional.ToList(allowedJobs), lastFailedEnableProtectionJob.Value, lastFailedPlannedFailoverJob.Value, lastTestFailoverJob.Value, Optional.ToNullable(replicationHealth), Optional.ToList(healthErrors), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.cs new file mode 100644 index 000000000000..8b3f8a01a97b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelProperties.cs @@ -0,0 +1,169 @@ +// 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.Recoveryservicesdatareplication.Models +{ + /// Protected item model properties. + public partial class ProtectedItemModelProperties + { + /// Initializes a new instance of ProtectedItemModelProperties. + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// , or is null. + public ProtectedItemModelProperties(string policyName, string replicationExtensionName, ProtectedItemModelCustomProperties customProperties) + { + Argument.AssertNotNull(policyName, nameof(policyName)); + Argument.AssertNotNull(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + AllowedJobs = new ChangeTrackingList(); + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of ProtectedItemModelProperties. + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the Dra. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the DRA Id. + /// Gets or sets the target DRA Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// + /// Gets or sets the allowed scenarios on the protected item. + /// + /// + /// + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// 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 . + /// + internal ProtectedItemModelProperties(string policyName, string replicationExtensionName, string correlationId, ProvisioningState? provisioningState, ProtectionState? protectionState, string protectionStateDescription, TestFailoverState? testFailoverState, string testFailoverStateDescription, ResynchronizationState? resynchronizationState, string fabricObjectId, string fabricObjectName, string sourceFabricProviderId, string targetFabricProviderId, string fabricId, string targetFabricId, string draId, string targetDraId, bool? resyncRequired, DateTimeOffset? lastSuccessfulPlannedFailoverOn, DateTimeOffset? lastSuccessfulUnplannedFailoverOn, DateTimeOffset? lastSuccessfulTestFailoverOn, ProtectedItemModelPropertiesCurrentJob currentJob, IReadOnlyList allowedJobs, ProtectedItemModelPropertiesLastFailedEnableProtectionJob lastFailedEnableProtectionJob, ProtectedItemModelPropertiesLastFailedPlannedFailoverJob lastFailedPlannedFailoverJob, ProtectedItemModelPropertiesLastTestFailoverJob lastTestFailoverJob, HealthStatus? replicationHealth, IReadOnlyList healthErrors, ProtectedItemModelCustomProperties customProperties) + { + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + CorrelationId = correlationId; + ProvisioningState = provisioningState; + ProtectionState = protectionState; + ProtectionStateDescription = protectionStateDescription; + TestFailoverState = testFailoverState; + TestFailoverStateDescription = testFailoverStateDescription; + ResynchronizationState = resynchronizationState; + FabricObjectId = fabricObjectId; + FabricObjectName = fabricObjectName; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + FabricId = fabricId; + TargetFabricId = targetFabricId; + DraId = draId; + TargetDraId = targetDraId; + ResyncRequired = resyncRequired; + LastSuccessfulPlannedFailoverOn = lastSuccessfulPlannedFailoverOn; + LastSuccessfulUnplannedFailoverOn = lastSuccessfulUnplannedFailoverOn; + LastSuccessfulTestFailoverOn = lastSuccessfulTestFailoverOn; + CurrentJob = currentJob; + AllowedJobs = allowedJobs; + LastFailedEnableProtectionJob = lastFailedEnableProtectionJob; + LastFailedPlannedFailoverJob = lastFailedPlannedFailoverJob; + LastTestFailoverJob = lastTestFailoverJob; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + CustomProperties = customProperties; + } + + /// Gets or sets the policy name. + public string PolicyName { get; set; } + /// Gets or sets the replication extension name. + public string ReplicationExtensionName { get; set; } + /// Gets or sets the protected item correlation Id. + public string CorrelationId { get; } + /// Gets or sets the provisioning state of the Dra. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the protection state. + public ProtectionState? ProtectionState { get; } + /// Gets or sets the protection state description. + public string ProtectionStateDescription { get; } + /// Gets or sets the test failover state. + public TestFailoverState? TestFailoverState { get; } + /// Gets or sets the Test failover state description. + public string TestFailoverStateDescription { get; } + /// Gets or sets the resynchronization state. + public ResynchronizationState? ResynchronizationState { get; } + /// Gets or sets the fabric object Id. + public string FabricObjectId { get; } + /// Gets or sets the fabric object name. + public string FabricObjectName { get; } + /// Gets or sets the source fabric provider Id. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider Id. + public string TargetFabricProviderId { get; } + /// Gets or sets the fabric Id. + public string FabricId { get; } + /// Gets or sets the target fabric Id. + public string TargetFabricId { get; } + /// Gets or sets the DRA Id. + public string DraId { get; } + /// Gets or sets the target DRA Id. + public string TargetDraId { get; } + /// Gets or sets a value indicating whether resynchronization is required or not. + public bool? ResyncRequired { get; } + /// Gets or sets the Last successful planned failover time. + public DateTimeOffset? LastSuccessfulPlannedFailoverOn { get; } + /// Gets or sets the Last successful unplanned failover time. + public DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get; } + /// Gets or sets the Last successful test failover time. + public DateTimeOffset? LastSuccessfulTestFailoverOn { get; } + /// Gets the current job. + public ProtectedItemModelPropertiesCurrentJob CurrentJob { get; } + /// Gets or sets the allowed scenarios on the protected item. + public IReadOnlyList AllowedJobs { get; } + /// Gets the last failed enable protection job. + public ProtectedItemModelPropertiesLastFailedEnableProtectionJob LastFailedEnableProtectionJob { get; } + /// Gets the last failed planned failover job. + public ProtectedItemModelPropertiesLastFailedPlannedFailoverJob LastFailedPlannedFailoverJob { get; } + /// Gets the last test failover job. + public ProtectedItemModelPropertiesLastTestFailoverJob LastTestFailoverJob { get; } + /// Gets or sets protected item replication health. + public HealthStatus? ReplicationHealth { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public ProtectedItemModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.Serialization.cs new file mode 100644 index 000000000000..8dba0cb4dc43 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelPropertiesCurrentJob + { + internal static ProtectedItemModelPropertiesCurrentJob DeserializeProtectedItemModelPropertiesCurrentJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scenarioName = default; + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ProtectedItemModelPropertiesCurrentJob(scenarioName.Value, id.Value, name.Value, displayName.Value, state.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.cs new file mode 100644 index 000000000000..a988fdb69d74 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesCurrentJob.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The ProtectedItemModelPropertiesCurrentJob. + public partial class ProtectedItemModelPropertiesCurrentJob : ProtectedItemJobProperties + { + /// Initializes a new instance of ProtectedItemModelPropertiesCurrentJob. + internal ProtectedItemModelPropertiesCurrentJob() + { + } + + /// Initializes a new instance of ProtectedItemModelPropertiesCurrentJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + internal ProtectedItemModelPropertiesCurrentJob(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn) : base(scenarioName, id, name, displayName, state, startOn, endOn) + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.Serialization.cs new file mode 100644 index 000000000000..d17226f7b174 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelPropertiesLastFailedEnableProtectionJob + { + internal static ProtectedItemModelPropertiesLastFailedEnableProtectionJob DeserializeProtectedItemModelPropertiesLastFailedEnableProtectionJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scenarioName = default; + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ProtectedItemModelPropertiesLastFailedEnableProtectionJob(scenarioName.Value, id.Value, name.Value, displayName.Value, state.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.cs new file mode 100644 index 000000000000..850cd0fe8b1d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedEnableProtectionJob.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The ProtectedItemModelPropertiesLastFailedEnableProtectionJob. + public partial class ProtectedItemModelPropertiesLastFailedEnableProtectionJob : ProtectedItemJobProperties + { + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedEnableProtectionJob. + internal ProtectedItemModelPropertiesLastFailedEnableProtectionJob() + { + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedEnableProtectionJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + internal ProtectedItemModelPropertiesLastFailedEnableProtectionJob(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn) : base(scenarioName, id, name, displayName, state, startOn, endOn) + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.Serialization.cs new file mode 100644 index 000000000000..6661485876da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelPropertiesLastFailedPlannedFailoverJob + { + internal static ProtectedItemModelPropertiesLastFailedPlannedFailoverJob DeserializeProtectedItemModelPropertiesLastFailedPlannedFailoverJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scenarioName = default; + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ProtectedItemModelPropertiesLastFailedPlannedFailoverJob(scenarioName.Value, id.Value, name.Value, displayName.Value, state.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.cs new file mode 100644 index 000000000000..79a153b13149 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastFailedPlannedFailoverJob.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The ProtectedItemModelPropertiesLastFailedPlannedFailoverJob. + public partial class ProtectedItemModelPropertiesLastFailedPlannedFailoverJob : ProtectedItemJobProperties + { + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedPlannedFailoverJob. + internal ProtectedItemModelPropertiesLastFailedPlannedFailoverJob() + { + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastFailedPlannedFailoverJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + internal ProtectedItemModelPropertiesLastFailedPlannedFailoverJob(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn) : base(scenarioName, id, name, displayName, state, startOn, endOn) + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.Serialization.cs new file mode 100644 index 000000000000..701b3713663f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ProtectedItemModelPropertiesLastTestFailoverJob + { + internal static ProtectedItemModelPropertiesLastTestFailoverJob DeserializeProtectedItemModelPropertiesLastTestFailoverJob(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scenarioName = default; + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ProtectedItemModelPropertiesLastTestFailoverJob(scenarioName.Value, id.Value, name.Value, displayName.Value, state.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.cs new file mode 100644 index 000000000000..2e3eb9d8df5b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectedItemModelPropertiesLastTestFailoverJob.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The ProtectedItemModelPropertiesLastTestFailoverJob. + public partial class ProtectedItemModelPropertiesLastTestFailoverJob : ProtectedItemJobProperties + { + /// Initializes a new instance of ProtectedItemModelPropertiesLastTestFailoverJob. + internal ProtectedItemModelPropertiesLastTestFailoverJob() + { + } + + /// Initializes a new instance of ProtectedItemModelPropertiesLastTestFailoverJob. + /// Gets or sets protection scenario name. + /// Gets or sets workflow Id. + /// Gets or sets workflow name. + /// Gets or sets the workflow friendly display name. + /// Gets or sets workflow state. + /// Gets or sets start time of the workflow. + /// Gets or sets end time of the workflow. + internal ProtectedItemModelPropertiesLastTestFailoverJob(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn) : base(scenarioName, id, name, displayName, state, startOn, endOn) + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectionState.cs new file mode 100644 index 000000000000..3f7e8c91a822 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProtectionState.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the protection state. + public readonly partial struct ProtectionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtectionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnprotectedStatesBeginValue = "UnprotectedStatesBegin"; + private const string EnablingProtectionValue = "EnablingProtection"; + private const string EnablingFailedValue = "EnablingFailed"; + private const string DisablingProtectionValue = "DisablingProtection"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + private const string DisablingFailedValue = "DisablingFailed"; + private const string UnprotectedStatesEndValue = "UnprotectedStatesEnd"; + private const string InitialReplicationStatesBeginValue = "InitialReplicationStatesBegin"; + private const string InitialReplicationInProgressValue = "InitialReplicationInProgress"; + private const string InitialReplicationCompletedOnPrimaryValue = "InitialReplicationCompletedOnPrimary"; + private const string InitialReplicationCompletedOnRecoveryValue = "InitialReplicationCompletedOnRecovery"; + private const string InitialReplicationFailedValue = "InitialReplicationFailed"; + private const string InitialReplicationStatesEndValue = "InitialReplicationStatesEnd"; + private const string ProtectedStatesBeginValue = "ProtectedStatesBegin"; + private const string ProtectedValue = "Protected"; + private const string ProtectedStatesEndValue = "ProtectedStatesEnd"; + private const string PlannedFailoverTransitionStatesBeginValue = "PlannedFailoverTransitionStatesBegin"; + private const string PlannedFailoverInitiatedValue = "PlannedFailoverInitiated"; + private const string PlannedFailoverCompletingValue = "PlannedFailoverCompleting"; + private const string PlannedFailoverCompletedValue = "PlannedFailoverCompleted"; + private const string PlannedFailoverFailedValue = "PlannedFailoverFailed"; + private const string PlannedFailoverCompletionFailedValue = "PlannedFailoverCompletionFailed"; + private const string PlannedFailoverTransitionStatesEndValue = "PlannedFailoverTransitionStatesEnd"; + private const string UnplannedFailoverTransitionStatesBeginValue = "UnplannedFailoverTransitionStatesBegin"; + private const string UnplannedFailoverInitiatedValue = "UnplannedFailoverInitiated"; + private const string UnplannedFailoverCompletingValue = "UnplannedFailoverCompleting"; + private const string UnplannedFailoverCompletedValue = "UnplannedFailoverCompleted"; + private const string UnplannedFailoverFailedValue = "UnplannedFailoverFailed"; + private const string UnplannedFailoverCompletionFailedValue = "UnplannedFailoverCompletionFailed"; + private const string UnplannedFailoverTransitionStatesEndValue = "UnplannedFailoverTransitionStatesEnd"; + private const string CommitFailoverStatesBeginValue = "CommitFailoverStatesBegin"; + private const string CommitFailoverInProgressOnPrimaryValue = "CommitFailoverInProgressOnPrimary"; + private const string CommitFailoverInProgressOnRecoveryValue = "CommitFailoverInProgressOnRecovery"; + private const string CommitFailoverCompletedValue = "CommitFailoverCompleted"; + private const string CommitFailoverFailedOnPrimaryValue = "CommitFailoverFailedOnPrimary"; + private const string CommitFailoverFailedOnRecoveryValue = "CommitFailoverFailedOnRecovery"; + private const string CommitFailoverStatesEndValue = "CommitFailoverStatesEnd"; + private const string CancelFailoverStatesBeginValue = "CancelFailoverStatesBegin"; + private const string CancelFailoverInProgressOnPrimaryValue = "CancelFailoverInProgressOnPrimary"; + private const string CancelFailoverInProgressOnRecoveryValue = "CancelFailoverInProgressOnRecovery"; + private const string CancelFailoverFailedOnPrimaryValue = "CancelFailoverFailedOnPrimary"; + private const string CancelFailoverFailedOnRecoveryValue = "CancelFailoverFailedOnRecovery"; + private const string CancelFailoverStatesEndValue = "CancelFailoverStatesEnd"; + private const string ChangeRecoveryPointStatesBeginValue = "ChangeRecoveryPointStatesBegin"; + private const string ChangeRecoveryPointInitiatedValue = "ChangeRecoveryPointInitiated"; + private const string ChangeRecoveryPointCompletedValue = "ChangeRecoveryPointCompleted"; + private const string ChangeRecoveryPointFailedValue = "ChangeRecoveryPointFailed"; + private const string ChangeRecoveryPointStatesEndValue = "ChangeRecoveryPointStatesEnd"; + private const string ReprotectStatesBeginValue = "ReprotectStatesBegin"; + private const string ReprotectInitiatedValue = "ReprotectInitiated"; + private const string ReprotectFailedValue = "ReprotectFailed"; + private const string ReprotectStatesEndValue = "ReprotectStatesEnd"; + + /// UnprotectedStatesBegin. + public static ProtectionState UnprotectedStatesBegin { get; } = new ProtectionState(UnprotectedStatesBeginValue); + /// EnablingProtection. + public static ProtectionState EnablingProtection { get; } = new ProtectionState(EnablingProtectionValue); + /// EnablingFailed. + public static ProtectionState EnablingFailed { get; } = new ProtectionState(EnablingFailedValue); + /// DisablingProtection. + public static ProtectionState DisablingProtection { get; } = new ProtectionState(DisablingProtectionValue); + /// MarkedForDeletion. + public static ProtectionState MarkedForDeletion { get; } = new ProtectionState(MarkedForDeletionValue); + /// DisablingFailed. + public static ProtectionState DisablingFailed { get; } = new ProtectionState(DisablingFailedValue); + /// UnprotectedStatesEnd. + public static ProtectionState UnprotectedStatesEnd { get; } = new ProtectionState(UnprotectedStatesEndValue); + /// InitialReplicationStatesBegin. + public static ProtectionState InitialReplicationStatesBegin { get; } = new ProtectionState(InitialReplicationStatesBeginValue); + /// InitialReplicationInProgress. + public static ProtectionState InitialReplicationInProgress { get; } = new ProtectionState(InitialReplicationInProgressValue); + /// InitialReplicationCompletedOnPrimary. + public static ProtectionState InitialReplicationCompletedOnPrimary { get; } = new ProtectionState(InitialReplicationCompletedOnPrimaryValue); + /// InitialReplicationCompletedOnRecovery. + public static ProtectionState InitialReplicationCompletedOnRecovery { get; } = new ProtectionState(InitialReplicationCompletedOnRecoveryValue); + /// InitialReplicationFailed. + public static ProtectionState InitialReplicationFailed { get; } = new ProtectionState(InitialReplicationFailedValue); + /// InitialReplicationStatesEnd. + public static ProtectionState InitialReplicationStatesEnd { get; } = new ProtectionState(InitialReplicationStatesEndValue); + /// ProtectedStatesBegin. + public static ProtectionState ProtectedStatesBegin { get; } = new ProtectionState(ProtectedStatesBeginValue); + /// Protected. + public static ProtectionState Protected { get; } = new ProtectionState(ProtectedValue); + /// ProtectedStatesEnd. + public static ProtectionState ProtectedStatesEnd { get; } = new ProtectionState(ProtectedStatesEndValue); + /// PlannedFailoverTransitionStatesBegin. + public static ProtectionState PlannedFailoverTransitionStatesBegin { get; } = new ProtectionState(PlannedFailoverTransitionStatesBeginValue); + /// PlannedFailoverInitiated. + public static ProtectionState PlannedFailoverInitiated { get; } = new ProtectionState(PlannedFailoverInitiatedValue); + /// PlannedFailoverCompleting. + public static ProtectionState PlannedFailoverCompleting { get; } = new ProtectionState(PlannedFailoverCompletingValue); + /// PlannedFailoverCompleted. + public static ProtectionState PlannedFailoverCompleted { get; } = new ProtectionState(PlannedFailoverCompletedValue); + /// PlannedFailoverFailed. + public static ProtectionState PlannedFailoverFailed { get; } = new ProtectionState(PlannedFailoverFailedValue); + /// PlannedFailoverCompletionFailed. + public static ProtectionState PlannedFailoverCompletionFailed { get; } = new ProtectionState(PlannedFailoverCompletionFailedValue); + /// PlannedFailoverTransitionStatesEnd. + public static ProtectionState PlannedFailoverTransitionStatesEnd { get; } = new ProtectionState(PlannedFailoverTransitionStatesEndValue); + /// UnplannedFailoverTransitionStatesBegin. + public static ProtectionState UnplannedFailoverTransitionStatesBegin { get; } = new ProtectionState(UnplannedFailoverTransitionStatesBeginValue); + /// UnplannedFailoverInitiated. + public static ProtectionState UnplannedFailoverInitiated { get; } = new ProtectionState(UnplannedFailoverInitiatedValue); + /// UnplannedFailoverCompleting. + public static ProtectionState UnplannedFailoverCompleting { get; } = new ProtectionState(UnplannedFailoverCompletingValue); + /// UnplannedFailoverCompleted. + public static ProtectionState UnplannedFailoverCompleted { get; } = new ProtectionState(UnplannedFailoverCompletedValue); + /// UnplannedFailoverFailed. + public static ProtectionState UnplannedFailoverFailed { get; } = new ProtectionState(UnplannedFailoverFailedValue); + /// UnplannedFailoverCompletionFailed. + public static ProtectionState UnplannedFailoverCompletionFailed { get; } = new ProtectionState(UnplannedFailoverCompletionFailedValue); + /// UnplannedFailoverTransitionStatesEnd. + public static ProtectionState UnplannedFailoverTransitionStatesEnd { get; } = new ProtectionState(UnplannedFailoverTransitionStatesEndValue); + /// CommitFailoverStatesBegin. + public static ProtectionState CommitFailoverStatesBegin { get; } = new ProtectionState(CommitFailoverStatesBeginValue); + /// CommitFailoverInProgressOnPrimary. + public static ProtectionState CommitFailoverInProgressOnPrimary { get; } = new ProtectionState(CommitFailoverInProgressOnPrimaryValue); + /// CommitFailoverInProgressOnRecovery. + public static ProtectionState CommitFailoverInProgressOnRecovery { get; } = new ProtectionState(CommitFailoverInProgressOnRecoveryValue); + /// CommitFailoverCompleted. + public static ProtectionState CommitFailoverCompleted { get; } = new ProtectionState(CommitFailoverCompletedValue); + /// CommitFailoverFailedOnPrimary. + public static ProtectionState CommitFailoverFailedOnPrimary { get; } = new ProtectionState(CommitFailoverFailedOnPrimaryValue); + /// CommitFailoverFailedOnRecovery. + public static ProtectionState CommitFailoverFailedOnRecovery { get; } = new ProtectionState(CommitFailoverFailedOnRecoveryValue); + /// CommitFailoverStatesEnd. + public static ProtectionState CommitFailoverStatesEnd { get; } = new ProtectionState(CommitFailoverStatesEndValue); + /// CancelFailoverStatesBegin. + public static ProtectionState CancelFailoverStatesBegin { get; } = new ProtectionState(CancelFailoverStatesBeginValue); + /// CancelFailoverInProgressOnPrimary. + public static ProtectionState CancelFailoverInProgressOnPrimary { get; } = new ProtectionState(CancelFailoverInProgressOnPrimaryValue); + /// CancelFailoverInProgressOnRecovery. + public static ProtectionState CancelFailoverInProgressOnRecovery { get; } = new ProtectionState(CancelFailoverInProgressOnRecoveryValue); + /// CancelFailoverFailedOnPrimary. + public static ProtectionState CancelFailoverFailedOnPrimary { get; } = new ProtectionState(CancelFailoverFailedOnPrimaryValue); + /// CancelFailoverFailedOnRecovery. + public static ProtectionState CancelFailoverFailedOnRecovery { get; } = new ProtectionState(CancelFailoverFailedOnRecoveryValue); + /// CancelFailoverStatesEnd. + public static ProtectionState CancelFailoverStatesEnd { get; } = new ProtectionState(CancelFailoverStatesEndValue); + /// ChangeRecoveryPointStatesBegin. + public static ProtectionState ChangeRecoveryPointStatesBegin { get; } = new ProtectionState(ChangeRecoveryPointStatesBeginValue); + /// ChangeRecoveryPointInitiated. + public static ProtectionState ChangeRecoveryPointInitiated { get; } = new ProtectionState(ChangeRecoveryPointInitiatedValue); + /// ChangeRecoveryPointCompleted. + public static ProtectionState ChangeRecoveryPointCompleted { get; } = new ProtectionState(ChangeRecoveryPointCompletedValue); + /// ChangeRecoveryPointFailed. + public static ProtectionState ChangeRecoveryPointFailed { get; } = new ProtectionState(ChangeRecoveryPointFailedValue); + /// ChangeRecoveryPointStatesEnd. + public static ProtectionState ChangeRecoveryPointStatesEnd { get; } = new ProtectionState(ChangeRecoveryPointStatesEndValue); + /// ReprotectStatesBegin. + public static ProtectionState ReprotectStatesBegin { get; } = new ProtectionState(ReprotectStatesBeginValue); + /// ReprotectInitiated. + public static ProtectionState ReprotectInitiated { get; } = new ProtectionState(ReprotectInitiatedValue); + /// ReprotectFailed. + public static ProtectionState ReprotectFailed { get; } = new ProtectionState(ReprotectFailedValue); + /// ReprotectStatesEnd. + public static ProtectionState ReprotectStatesEnd { get; } = new ProtectionState(ReprotectStatesEndValue); + /// Determines if two values are the same. + public static bool operator ==(ProtectionState left, ProtectionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtectionState left, ProtectionState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProtectionState(string value) => new ProtectionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtectionState other && Equals(other); + /// + public bool Equals(ProtectionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProvisioningState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..7bf20c6ec772 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the provisioning state of the Dra. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + + /// Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Creating. + public static ProvisioningState Creating { get; } = new ProvisioningState(CreatingValue); + /// Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Deleted. + public static ProvisioningState Deleted { get; } = new ProvisioningState(DeletedValue); + /// Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.Serialization.cs new file mode 100644 index 000000000000..8f5384c08377 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class RecoveryPointModelCollection + { + internal static RecoveryPointModelCollection DeserializeRecoveryPointModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(RecoveryPointModelData.DeserializeRecoveryPointModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new RecoveryPointModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.cs new file mode 100644 index 000000000000..d34b9c079b40 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Recovery point model collection. + internal partial class RecoveryPointModelCollection + { + /// Initializes a new instance of RecoveryPointModelCollection. + internal RecoveryPointModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RecoveryPointModelCollection. + /// Gets or sets the list of recovery points. + /// Gets or sets the value of next link. + internal RecoveryPointModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of recovery points. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..bf60eff9a1ee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class RecoveryPointModelCustomProperties + { + internal static RecoveryPointModelCustomProperties DeserializeRecoveryPointModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIRecoveryPointModelCustomProperties.DeserializeHyperVToAzStackHCIRecoveryPointModelCustomProperties(element); + } + } + return UnknownRecoveryPointModelCustomProperties.DeserializeUnknownRecoveryPointModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..02913e4eff30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Recovery point model custom properties. + /// 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 RecoveryPointModelCustomProperties + { + /// Initializes a new instance of RecoveryPointModelCustomProperties. + protected RecoveryPointModelCustomProperties() + { + } + + /// Initializes a new instance of RecoveryPointModelCustomProperties. + /// Gets or sets the instance type. + internal RecoveryPointModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelData.Serialization.cs new file mode 100644 index 000000000000..bffe74e61e9d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelData.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class RecoveryPointModelData + { + internal static RecoveryPointModelData DeserializeRecoveryPointModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RecoveryPointModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RecoveryPointModelProperties.DeserializeRecoveryPointModelProperties(property.Value); + 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; + } + } + return new RecoveryPointModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs new file mode 100644 index 000000000000..42bfa15c9671 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class RecoveryPointModelProperties + { + internal static RecoveryPointModelProperties DeserializeRecoveryPointModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset recoveryPointTime = default; + RecoveryPointType recoveryPointType = default; + RecoveryPointModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointTime"u8)) + { + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recoveryPointType"u8)) + { + recoveryPointType = new RecoveryPointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = RecoveryPointModelCustomProperties.DeserializeRecoveryPointModelCustomProperties(property.Value); + continue; + } + } + return new RecoveryPointModelProperties(recoveryPointTime, recoveryPointType, customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.cs new file mode 100644 index 000000000000..14dcaaa4c6c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointModelProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Recovery point model properties. + public partial class RecoveryPointModelProperties + { + /// Initializes a new instance of RecoveryPointModelProperties. + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// 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. + internal RecoveryPointModelProperties(DateTimeOffset recoveryPointOn, RecoveryPointType recoveryPointType, RecoveryPointModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + } + + /// Gets or sets the recovery point time. + public DateTimeOffset RecoveryPointOn { get; } + /// Gets or sets the recovery point type. + public RecoveryPointType RecoveryPointType { get; } + /// + /// Recovery point model custom properties. + /// 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 RecoveryPointModelCustomProperties CustomProperties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointType.cs new file mode 100644 index 000000000000..b1a6f5b4036d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/RecoveryPointType.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the recovery point type. + public readonly partial struct RecoveryPointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RecoveryPointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationConsistentValue = "ApplicationConsistent"; + private const string CrashConsistentValue = "CrashConsistent"; + + /// ApplicationConsistent. + public static RecoveryPointType ApplicationConsistent { get; } = new RecoveryPointType(ApplicationConsistentValue); + /// CrashConsistent. + public static RecoveryPointType CrashConsistent { get; } = new RecoveryPointType(CrashConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(RecoveryPointType left, RecoveryPointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RecoveryPointType left, RecoveryPointType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RecoveryPointType(string value) => new RecoveryPointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RecoveryPointType other && Equals(other); + /// + public bool Equals(RecoveryPointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.Serialization.cs new file mode 100644 index 000000000000..866dab6df38f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class ReplicationExtensionModelCollection + { + internal static ReplicationExtensionModelCollection DeserializeReplicationExtensionModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ReplicationExtensionModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.cs new file mode 100644 index 000000000000..b60e6a570cbd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Replication extension model collection. + internal partial class ReplicationExtensionModelCollection + { + /// Initializes a new instance of ReplicationExtensionModelCollection. + internal ReplicationExtensionModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReplicationExtensionModelCollection. + /// Gets or sets the list of replication extensions. + /// Gets or sets the value of next link. + internal ReplicationExtensionModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of replication extensions. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..9eed47b86030 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ReplicationExtensionModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static ReplicationExtensionModelCustomProperties DeserializeReplicationExtensionModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHCIReplicationExtensionModelCustomProperties.DeserializeHyperVToAzStackHCIReplicationExtensionModelCustomProperties(element); + case "VMwareToAzStackHCI": return VMwareToAzStackHCIReplicationExtensionModelCustomProperties.DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(element); + } + } + return UnknownReplicationExtensionModelCustomProperties.DeserializeUnknownReplicationExtensionModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..efba53f97580 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of ReplicationExtensionModelCustomProperties. + protected ReplicationExtensionModelCustomProperties() + { + } + + /// Initializes a new instance of ReplicationExtensionModelCustomProperties. + /// Gets or sets the instance type. + internal ReplicationExtensionModelCustomProperties(string instanceType) + { + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelData.Serialization.cs new file mode 100644 index 000000000000..5db0804bdd3f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelData.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class ReplicationExtensionModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WriteEndObject(); + } + + internal static ReplicationExtensionModelData DeserializeReplicationExtensionModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ReplicationExtensionModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = ReplicationExtensionModelProperties.DeserializeReplicationExtensionModelProperties(property.Value); + 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; + } + } + return new ReplicationExtensionModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs new file mode 100644 index 000000000000..3068e4da3629 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class ReplicationExtensionModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties); + writer.WriteEndObject(); + } + + internal static ReplicationExtensionModelProperties DeserializeReplicationExtensionModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provisioningState = default; + ReplicationExtensionModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = ReplicationExtensionModelCustomProperties.DeserializeReplicationExtensionModelCustomProperties(property.Value); + continue; + } + } + return new ReplicationExtensionModelProperties(Optional.ToNullable(provisioningState), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.cs new file mode 100644 index 000000000000..375698d1496f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationExtensionModelProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Replication extension model properties. + public partial class ReplicationExtensionModelProperties + { + /// Initializes a new instance of ReplicationExtensionModelProperties. + /// + /// Replication extension model custom properties. + /// 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 . + /// + /// is null. + public ReplicationExtensionModelProperties(ReplicationExtensionModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of ReplicationExtensionModelProperties. + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// 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 . + /// + internal ReplicationExtensionModelProperties(ProvisioningState? provisioningState, ReplicationExtensionModelCustomProperties customProperties) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + } + + /// Gets or sets the provisioning state of the replication extension. + public ProvisioningState? ProvisioningState { get; } + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public ReplicationExtensionModelCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationVaultType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationVaultType.cs new file mode 100644 index 000000000000..985fce2a5926 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ReplicationVaultType.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the type of vault. + public readonly partial struct ReplicationVaultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReplicationVaultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisasterRecoveryValue = "DisasterRecovery"; + private const string MigrateValue = "Migrate"; + + /// DisasterRecovery. + public static ReplicationVaultType DisasterRecovery { get; } = new ReplicationVaultType(DisasterRecoveryValue); + /// Migrate. + public static ReplicationVaultType Migrate { get; } = new ReplicationVaultType(MigrateValue); + /// Determines if two values are the same. + public static bool operator ==(ReplicationVaultType left, ReplicationVaultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReplicationVaultType left, ReplicationVaultType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReplicationVaultType(string value) => new ReplicationVaultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReplicationVaultType other && Equals(other); + /// + public bool Equals(ReplicationVaultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ResynchronizationState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ResynchronizationState.cs new file mode 100644 index 000000000000..64301ceca060 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/ResynchronizationState.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the resynchronization state. + public readonly partial struct ResynchronizationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResynchronizationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ResynchronizationInitiatedValue = "ResynchronizationInitiated"; + private const string ResynchronizationCompletedValue = "ResynchronizationCompleted"; + private const string ResynchronizationFailedValue = "ResynchronizationFailed"; + + /// None. + public static ResynchronizationState None { get; } = new ResynchronizationState(NoneValue); + /// ResynchronizationInitiated. + public static ResynchronizationState ResynchronizationInitiated { get; } = new ResynchronizationState(ResynchronizationInitiatedValue); + /// ResynchronizationCompleted. + public static ResynchronizationState ResynchronizationCompleted { get; } = new ResynchronizationState(ResynchronizationCompletedValue); + /// ResynchronizationFailed. + public static ResynchronizationState ResynchronizationFailed { get; } = new ResynchronizationState(ResynchronizationFailedValue); + /// Determines if two values are the same. + public static bool operator ==(ResynchronizationState left, ResynchronizationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResynchronizationState left, ResynchronizationState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResynchronizationState(string value) => new ResynchronizationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResynchronizationState other && Equals(other); + /// + public bool Equals(ResynchronizationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.Serialization.cs new file mode 100644 index 000000000000..4e8a461ccc6a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class StorageContainerProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("clusterSharedVolumePath"u8); + writer.WriteStringValue(ClusterSharedVolumePath); + writer.WriteEndObject(); + } + + internal static StorageContainerProperties DeserializeStorageContainerProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string clusterSharedVolumePath = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterSharedVolumePath"u8)) + { + clusterSharedVolumePath = property.Value.GetString(); + continue; + } + } + return new StorageContainerProperties(name, clusterSharedVolumePath); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.cs new file mode 100644 index 000000000000..3006405ce127 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/StorageContainerProperties.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Storage container properties. + public partial class StorageContainerProperties + { + /// Initializes a new instance of StorageContainerProperties. + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// or is null. + public StorageContainerProperties(string name, string clusterSharedVolumePath) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(clusterSharedVolumePath, nameof(clusterSharedVolumePath)); + + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + } + + /// Gets or sets the Name. + public string Name { get; set; } + /// Gets or sets the ClusterSharedVolumePath. + public string ClusterSharedVolumePath { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.Serialization.cs new file mode 100644 index 000000000000..6f5eb3ef9930 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class TaskModel + { + internal static TaskModel DeserializeTaskModel(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional taskName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + Optional customProperties = default; + Optional> childrenWorkflows = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskName"u8)) + { + taskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new TaskState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = TaskModelCustomProperties.DeserializeTaskModelCustomProperties(property.Value); + continue; + } + if (property.NameEquals("childrenWorkflows"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WorkflowModelData.DeserializeWorkflowModelData(item)); + } + childrenWorkflows = array; + continue; + } + } + return new TaskModel(taskName.Value, Optional.ToNullable(state), Optional.ToNullable(startTime), Optional.ToNullable(endTime), customProperties.Value, Optional.ToList(childrenWorkflows)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.cs new file mode 100644 index 000000000000..9f1cb686f190 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModel.cs @@ -0,0 +1,60 @@ +// 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.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Task model. + public partial class TaskModel + { + /// Initializes a new instance of TaskModel. + internal TaskModel() + { + ChildrenWorkflows = new ChangeTrackingList(); + } + + /// Initializes a new instance of TaskModel. + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children workflow models. + internal TaskModel(string taskName, TaskState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, TaskModelCustomProperties customProperties, IReadOnlyList childrenWorkflows) + { + TaskName = taskName; + State = state; + StartOn = startOn; + EndOn = endOn; + CustomProperties = customProperties; + ChildrenWorkflows = childrenWorkflows; + } + + /// Gets or sets the task name. + public string TaskName { get; } + /// Gets or sets the task state. + public TaskState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Task model custom properties. + internal TaskModelCustomProperties CustomProperties { get; } + /// Gets or sets the instance type. + public string CustomInstanceType + { + get => CustomProperties?.InstanceType; + } + + /// Gets or sets the list of children workflow models. + public IReadOnlyList ChildrenWorkflows { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..6b1cb8b09a70 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class TaskModelCustomProperties + { + internal static TaskModelCustomProperties DeserializeTaskModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new TaskModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.cs new file mode 100644 index 000000000000..8d1bed1c026b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskModelCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Task model custom properties. + internal partial class TaskModelCustomProperties + { + /// Initializes a new instance of TaskModelCustomProperties. + /// Gets or sets the instance type. + /// is null. + internal TaskModelCustomProperties(string instanceType) + { + Argument.AssertNotNull(instanceType, nameof(instanceType)); + + InstanceType = instanceType; + } + + /// Gets or sets the instance type. + public string InstanceType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskState.cs new file mode 100644 index 000000000000..312953ae09b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TaskState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the task state. + public readonly partial struct TaskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TaskState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string SkippedValue = "Skipped"; + + /// Pending. + public static TaskState Pending { get; } = new TaskState(PendingValue); + /// Started. + public static TaskState Started { get; } = new TaskState(StartedValue); + /// Succeeded. + public static TaskState Succeeded { get; } = new TaskState(SucceededValue); + /// Failed. + public static TaskState Failed { get; } = new TaskState(FailedValue); + /// Cancelled. + public static TaskState Cancelled { get; } = new TaskState(CancelledValue); + /// Skipped. + public static TaskState Skipped { get; } = new TaskState(SkippedValue); + /// Determines if two values are the same. + public static bool operator ==(TaskState left, TaskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TaskState left, TaskState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TaskState(string value) => new TaskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TaskState other && Equals(other); + /// + public bool Equals(TaskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..aa0e01584ef7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class TestFailoverCleanupWorkflowModelCustomProperties + { + internal static TestFailoverCleanupWorkflowModelCustomProperties DeserializeTestFailoverCleanupWorkflowModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional comments = default; + string instanceType = default; + Optional> affectedObjectDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("comments"u8)) + { + comments = 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; + } + } + return new TestFailoverCleanupWorkflowModelCustomProperties(instanceType, Optional.ToDictionary(affectedObjectDetails), comments.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.cs new file mode 100644 index 000000000000..8bd969652111 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverCleanupWorkflowModelCustomProperties.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Test failover cleanup workflow model custom properties. + public partial class TestFailoverCleanupWorkflowModelCustomProperties : WorkflowModelCustomProperties + { + /// Initializes a new instance of TestFailoverCleanupWorkflowModelCustomProperties. + internal TestFailoverCleanupWorkflowModelCustomProperties() + { + InstanceType = "TestFailoverCleanupWorkflowDetails"; + } + + /// Initializes a new instance of TestFailoverCleanupWorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test failover cleanup comments. + internal TestFailoverCleanupWorkflowModelCustomProperties(string instanceType, IReadOnlyDictionary affectedObjectDetails, string comments) : base(instanceType, affectedObjectDetails) + { + Comments = comments; + InstanceType = instanceType ?? "TestFailoverCleanupWorkflowDetails"; + } + + /// Gets or sets the test failover cleanup comments. + public string Comments { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverState.cs new file mode 100644 index 000000000000..065a1f30032e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the test failover state. + public readonly partial struct TestFailoverState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestFailoverState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string TestFailoverInitiatedValue = "TestFailoverInitiated"; + private const string TestFailoverCompletingValue = "TestFailoverCompleting"; + private const string TestFailoverCompletedValue = "TestFailoverCompleted"; + private const string TestFailoverFailedValue = "TestFailoverFailed"; + private const string TestFailoverCompletionFailedValue = "TestFailoverCompletionFailed"; + private const string TestFailoverCleanupInitiatedValue = "TestFailoverCleanupInitiated"; + private const string TestFailoverCleanupCompletingValue = "TestFailoverCleanupCompleting"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + + /// None. + public static TestFailoverState None { get; } = new TestFailoverState(NoneValue); + /// TestFailoverInitiated. + public static TestFailoverState TestFailoverInitiated { get; } = new TestFailoverState(TestFailoverInitiatedValue); + /// TestFailoverCompleting. + public static TestFailoverState TestFailoverCompleting { get; } = new TestFailoverState(TestFailoverCompletingValue); + /// TestFailoverCompleted. + public static TestFailoverState TestFailoverCompleted { get; } = new TestFailoverState(TestFailoverCompletedValue); + /// TestFailoverFailed. + public static TestFailoverState TestFailoverFailed { get; } = new TestFailoverState(TestFailoverFailedValue); + /// TestFailoverCompletionFailed. + public static TestFailoverState TestFailoverCompletionFailed { get; } = new TestFailoverState(TestFailoverCompletionFailedValue); + /// TestFailoverCleanupInitiated. + public static TestFailoverState TestFailoverCleanupInitiated { get; } = new TestFailoverState(TestFailoverCleanupInitiatedValue); + /// TestFailoverCleanupCompleting. + public static TestFailoverState TestFailoverCleanupCompleting { get; } = new TestFailoverState(TestFailoverCleanupCompletingValue); + /// MarkedForDeletion. + public static TestFailoverState MarkedForDeletion { get; } = new TestFailoverState(MarkedForDeletionValue); + /// Determines if two values are the same. + public static bool operator ==(TestFailoverState left, TestFailoverState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestFailoverState left, TestFailoverState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TestFailoverState(string value) => new TestFailoverState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestFailoverState other && Equals(other); + /// + public bool Equals(TestFailoverState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..82fb1e44d84b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class TestFailoverWorkflowModelCustomProperties + { + internal static TestFailoverWorkflowModelCustomProperties DeserializeTestFailoverWorkflowModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> protectedItemDetails = default; + string instanceType = default; + Optional> affectedObjectDetails = default; + 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(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item)); + } + 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; + } + } + return new TestFailoverWorkflowModelCustomProperties(instanceType, Optional.ToDictionary(affectedObjectDetails), Optional.ToList(protectedItemDetails)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.cs new file mode 100644 index 000000000000..54ec8b1c40a6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/TestFailoverWorkflowModelCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Test failover workflow model custom properties. + public partial class TestFailoverWorkflowModelCustomProperties : WorkflowModelCustomProperties + { + /// Initializes a new instance of TestFailoverWorkflowModelCustomProperties. + internal TestFailoverWorkflowModelCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "TestFailoverWorkflowDetails"; + } + + /// Initializes a new instance of TestFailoverWorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test VM details. + internal TestFailoverWorkflowModelCustomProperties(string instanceType, IReadOnlyDictionary affectedObjectDetails, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "TestFailoverWorkflowDetails"; + } + + /// Gets or sets the test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..651e65d1e2d6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownDraModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownDraModelCustomProperties DeserializeUnknownDraModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownDraModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.cs new file mode 100644 index 000000000000..2050d631dd55 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownDraModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownDraModelCustomProperties. + internal partial class UnknownDraModelCustomProperties : DraModelCustomProperties + { + /// Initializes a new instance of UnknownDraModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownDraModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..16bdea418a6c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownEventModelCustomProperties + { + internal static UnknownEventModelCustomProperties DeserializeUnknownEventModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownEventModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.cs new file mode 100644 index 000000000000..e584dd15389b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownEventModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownEventModelCustomProperties. + internal partial class UnknownEventModelCustomProperties : EventModelCustomProperties + { + /// Initializes a new instance of UnknownEventModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownEventModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..3b5f33bb6269 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownFabricModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownFabricModelCustomProperties DeserializeUnknownFabricModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownFabricModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs new file mode 100644 index 000000000000..91aeaaf3138d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownFabricModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownFabricModelCustomProperties. + internal partial class UnknownFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of UnknownFabricModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownFabricModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..9efdb1a90df8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownPlannedFailoverModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownPlannedFailoverModelCustomProperties DeserializeUnknownPlannedFailoverModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownPlannedFailoverModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..ce930582f88d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownPlannedFailoverModelCustomProperties. + internal partial class UnknownPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of UnknownPlannedFailoverModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownPlannedFailoverModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..597aed6d5dee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownPolicyModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownPolicyModelCustomProperties DeserializeUnknownPolicyModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownPolicyModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..bba0c55dedec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownPolicyModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownPolicyModelCustomProperties. + internal partial class UnknownPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of UnknownPolicyModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownPolicyModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..b0dffbf55d18 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownProtectedItemModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownProtectedItemModelCustomProperties DeserializeUnknownProtectedItemModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownProtectedItemModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..a9fde8c8331e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownProtectedItemModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownProtectedItemModelCustomProperties. + internal partial class UnknownProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of UnknownProtectedItemModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownProtectedItemModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..94da1155fe77 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownRecoveryPointModelCustomProperties + { + internal static UnknownRecoveryPointModelCustomProperties DeserializeUnknownRecoveryPointModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownRecoveryPointModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs new file mode 100644 index 000000000000..3d96fe222398 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownRecoveryPointModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownRecoveryPointModelCustomProperties. + internal partial class UnknownRecoveryPointModelCustomProperties : RecoveryPointModelCustomProperties + { + /// Initializes a new instance of UnknownRecoveryPointModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownRecoveryPointModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..b160926700e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownReplicationExtensionModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static UnknownReplicationExtensionModelCustomProperties DeserializeUnknownReplicationExtensionModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new UnknownReplicationExtensionModelCustomProperties(instanceType); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..a94d451af8a6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownReplicationExtensionModelCustomProperties. + internal partial class UnknownReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of UnknownReplicationExtensionModelCustomProperties. + /// Gets or sets the instance type. + internal UnknownReplicationExtensionModelCustomProperties(string instanceType) : base(instanceType) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ce9a6abfdc9d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class UnknownWorkflowModelCustomProperties + { + internal static UnknownWorkflowModelCustomProperties DeserializeUnknownWorkflowModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + Optional> affectedObjectDetails = default; + foreach (var property in element.EnumerateObject()) + { + 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; + } + } + return new UnknownWorkflowModelCustomProperties(instanceType, Optional.ToDictionary(affectedObjectDetails)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.cs new file mode 100644 index 000000000000..f55f7978a72b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/UnknownWorkflowModelCustomProperties.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// The UnknownWorkflowModelCustomProperties. + internal partial class UnknownWorkflowModelCustomProperties : WorkflowModelCustomProperties + { + /// Initializes a new instance of UnknownWorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + internal UnknownWorkflowModelCustomProperties(string instanceType, IReadOnlyDictionary affectedObjectDetails) : base(instanceType, affectedObjectDetails) + { + InstanceType = instanceType ?? "Unknown"; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d26ec3a91cf3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareDraModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("biosId"u8); + writer.WriteStringValue(BiosId); + writer.WritePropertyName("marsAuthenticationIdentity"u8); + writer.WriteObjectValue(MarsAuthenticationIdentity); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareDraModelCustomProperties DeserializeVMwareDraModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string biosId = default; + IdentityModel marsAuthenticationIdentity = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("biosId"u8)) + { + biosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marsAuthenticationIdentity"u8)) + { + marsAuthenticationIdentity = IdentityModel.DeserializeIdentityModel(property.Value); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareDraModelCustomProperties(instanceType, biosId, marsAuthenticationIdentity); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.cs new file mode 100644 index 000000000000..324a9e80218f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareDraModelCustomProperties.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware DRA model custom properties. + public partial class VMwareDraModelCustomProperties : DraModelCustomProperties + { + /// Initializes a new instance of VMwareDraModelCustomProperties. + /// Gets or sets the BIOS Id of the DRA machine. + /// Identity model. + /// or is null. + public VMwareDraModelCustomProperties(string biosId, IdentityModel marsAuthenticationIdentity) + { + Argument.AssertNotNull(biosId, nameof(biosId)); + Argument.AssertNotNull(marsAuthenticationIdentity, nameof(marsAuthenticationIdentity)); + + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = "VMware"; + } + + /// Initializes a new instance of VMwareDraModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the BIOS Id of the DRA machine. + /// Identity model. + internal VMwareDraModelCustomProperties(string instanceType, string biosId, IdentityModel marsAuthenticationIdentity) : base(instanceType) + { + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = instanceType ?? "VMware"; + } + + /// Gets or sets the BIOS Id of the DRA machine. + public string BiosId { get; set; } + /// Identity model. + public IdentityModel MarsAuthenticationIdentity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..84258b1c04a5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareMigrateFabricModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareMigrateFabricModelCustomProperties DeserializeVMwareMigrateFabricModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmwareSiteId = default; + string migrationSolutionId = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareMigrateFabricModelCustomProperties(instanceType, vmwareSiteId, migrationSolutionId); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs new file mode 100644 index 000000000000..55b286bd3c36 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareMigrateFabricModelCustomProperties.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware migrate fabric model custom properties. + public partial class VMwareMigrateFabricModelCustomProperties : FabricModelCustomProperties + { + /// Initializes a new instance of VMwareMigrateFabricModelCustomProperties. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + /// or is null. + public VMwareMigrateFabricModelCustomProperties(string vmwareSiteId, string migrationSolutionId) + { + Argument.AssertNotNull(vmwareSiteId, nameof(vmwareSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "VMwareMigrate"; + } + + /// Initializes a new instance of VMwareMigrateFabricModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + internal VMwareMigrateFabricModelCustomProperties(string instanceType, string vmwareSiteId, string migrationSolutionId) : base(instanceType) + { + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = instanceType ?? "VMwareMigrate"; + } + + /// Gets or sets the ARM Id of the VMware site. + public string VmwareSiteId { get; set; } + /// Gets or sets the ARM Id of the migration solution. + public string MigrationSolutionId { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs new file mode 100644 index 000000000000..26bf36e2a6bb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.Serialization.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIDiskInput : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCIDiskInput DeserializeVMwareToAzStackHCIDiskInput(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + Optional storageContainerId = default; + Optional isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + } + return new VMwareToAzStackHCIDiskInput(diskId, storageContainerId.Value, Optional.ToNullable(isDynamic), diskSizeGB, diskFileFormat, isOSDisk); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs new file mode 100644 index 000000000000..f1047050fe10 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIDiskInput.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMwareToAzStack disk input. + public partial class VMwareToAzStackHCIDiskInput + { + /// Initializes a new instance of VMwareToAzStackHCIDiskInput. + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public VMwareToAzStackHCIDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of VMwareToAzStackHCIDiskInput. + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + internal VMwareToAzStackHCIDiskInput(string diskId, string storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public string StorageContainerId { get; set; } + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs new file mode 100644 index 000000000000..71a14b0dba15 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCINicInput : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCINicInput DeserializeVMwareToAzStackHCINicInput(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string label = default; + Optional networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + } + return new VMwareToAzStackHCINicInput(nicId, label, networkName.Value, targetNetworkId, testNetworkId, selectionTypeForFailover); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs new file mode 100644 index 000000000000..d2527cf664d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCINicInput.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHCINicInput + { + /// Initializes a new instance of VMwareToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// , , or is null. + public VMwareToAzStackHCINicInput(string nicId, string label, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + Argument.AssertNotNull(label, nameof(label)); + Argument.AssertNotNull(targetNetworkId, nameof(targetNetworkId)); + Argument.AssertNotNull(testNetworkId, nameof(testNetworkId)); + + NicId = nicId; + Label = label; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of VMwareToAzStackHCINicInput. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + internal VMwareToAzStackHCINicInput(string nicId, string label, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover) + { + NicId = nicId; + Label = label; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the NIC label. + public string Label { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d9c96b455ff7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCIPlannedFailoverModelCustomProperties DeserializeVMwareToAzStackHCIPlannedFailoverModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareToAzStackHCIPlannedFailoverModelCustomProperties(instanceType, shutdownSourceVm); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs new file mode 100644 index 000000000000..e5434265c3a4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPlannedFailoverModelCustomProperties.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware to AzStackHCI planned failover model custom properties. + public partial class VMwareToAzStackHCIPlannedFailoverModelCustomProperties : PlannedFailoverModelCustomProperties + { + /// Initializes a new instance of VMwareToAzStackHCIPlannedFailoverModelCustomProperties. + /// Gets or sets a value indicating whether VM needs to be shut down. + public VMwareToAzStackHCIPlannedFailoverModelCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of VMwareToAzStackHCIPlannedFailoverModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal VMwareToAzStackHCIPlannedFailoverModelCustomProperties(string instanceType, bool shutdownSourceVm) : base(instanceType) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e7c26123c676 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.Serialization.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCIPolicyModelCustomProperties DeserializeVMwareToAzStackHCIPolicyModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareToAzStackHCIPolicyModelCustomProperties(instanceType, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs new file mode 100644 index 000000000000..309c249c4264 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIPolicyModelCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware To AzStackHCI Policy model custom properties. + public partial class VMwareToAzStackHCIPolicyModelCustomProperties : PolicyModelCustomProperties + { + /// Initializes a new instance of VMwareToAzStackHCIPolicyModelCustomProperties. + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public VMwareToAzStackHCIPolicyModelCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of VMwareToAzStackHCIPolicyModelCustomProperties. + /// Gets or sets the instance type. + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal VMwareToAzStackHCIPolicyModelCustomProperties(string instanceType, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// + /// Gets or sets the duration in minutes until which the recovery points need to be + /// stored. + /// + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..999ca11ad047 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIProtectedDiskProperties + { + internal static VMwareToAzStackHCIProtectedDiskProperties DeserializeVMwareToAzStackHCIProtectedDiskProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional storageContainerId = default; + Optional storageContainerLocalPath = default; + Optional sourceDiskId = default; + Optional sourceDiskName = default; + Optional seedDiskName = default; + Optional testMigrateDiskName = default; + Optional migrateDiskName = default; + Optional isOSDisk = default; + Optional capacityInBytes = default; + Optional isDynamic = default; + Optional diskType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + } + return new VMwareToAzStackHCIProtectedDiskProperties(storageContainerId.Value, storageContainerLocalPath.Value, sourceDiskId.Value, sourceDiskName.Value, seedDiskName.Value, testMigrateDiskName.Value, migrateDiskName.Value, Optional.ToNullable(isOSDisk), Optional.ToNullable(capacityInBytes), Optional.ToNullable(isDynamic), diskType.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs new file mode 100644 index 000000000000..046e92547ed6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedDiskProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMwareToAzStackHCI protected disk properties. + public partial class VMwareToAzStackHCIProtectedDiskProperties + { + /// Initializes a new instance of VMwareToAzStackHCIProtectedDiskProperties. + internal VMwareToAzStackHCIProtectedDiskProperties() + { + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedDiskProperties. + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + /// Gets or sets the disk type. + internal VMwareToAzStackHCIProtectedDiskProperties(string storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + } + + /// Gets or sets the ARM Id of the storage container. + public string StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard + /// disk. + /// + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a4bb553c3b6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.Serialization.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceDraName"u8); + writer.WriteStringValue(SourceDraName); + writer.WritePropertyName("targetDraName"u8); + writer.WriteStringValue(TargetDraName); + if (Optional.IsDefined(PerformAutoResync)) + { + writer.WritePropertyName("performAutoResync"u8); + writer.WriteBooleanValue(PerformAutoResync.Value); + } + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCIProtectedItemModelCustomProperties DeserializeVMwareToAzStackHCIProtectedItemModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional activeLocation = default; + string targetHciClusterId = default; + string targetArcClusterCustomLocationId = default; + Optional targetAzStackHciClusterName = default; + string storageContainerId = default; + string targetResourceGroupId = default; + Optional targetLocation = default; + string customLocationRegion = default; + IList disksToInclude = default; + IList nicsToInclude = default; + Optional> protectedDisks = default; + Optional> protectedNics = default; + Optional targetVmBiosId = default; + Optional targetVmName = default; + string hyperVGeneration = default; + Optional targetNetworkId = default; + Optional testNetworkId = default; + Optional targetCpuCores = default; + Optional isDynamicRam = default; + Optional dynamicMemoryConfig = default; + Optional targetMemoryInMegaBytes = default; + Optional osType = default; + Optional osName = default; + Optional firmwareType = default; + string fabricDiscoveryMachineId = default; + Optional sourceVmName = default; + Optional sourceCpuCores = default; + Optional sourceMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceDraName = default; + string targetDraName = default; + Optional sourceApplianceName = default; + Optional targetApplianceName = default; + Optional failoverRecoveryPointId = default; + Optional lastRecoveryPointReceived = default; + Optional lastRecoveryPointId = default; + Optional initialReplicationProgressPercentage = default; + Optional migrationProgressPercentage = default; + Optional resumeProgressPercentage = default; + Optional resyncProgressPercentage = default; + Optional resyncRetryCount = default; + Optional resyncRequired = default; + Optional resyncState = default; + Optional performAutoResync = default; + Optional resumeRetryCount = default; + Optional lastReplicationUpdateTime = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIDiskInput.DeserializeVMwareToAzStackHCIDiskInput(item)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCINicInput.DeserializeVMwareToAzStackHCINicInput(item)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIProtectedDiskProperties.DeserializeVMwareToAzStackHCIProtectedDiskProperties(item)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHCIProtectedNicProperties.DeserializeVMwareToAzStackHCIProtectedNicProperties(item)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDraName"u8)) + { + sourceDraName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetDraName"u8)) + { + targetDraName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("migrationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resumeProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resyncState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncState = new VMwareToAzureMigrateResyncState(property.Value.GetString()); + continue; + } + if (property.NameEquals("performAutoResync"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performAutoResync = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resumeRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareToAzStackHCIProtectedItemModelCustomProperties(instanceType, Optional.ToNullable(activeLocation), targetHciClusterId, targetArcClusterCustomLocationId, targetAzStackHciClusterName.Value, storageContainerId, targetResourceGroupId, targetLocation.Value, customLocationRegion, disksToInclude, nicsToInclude, Optional.ToList(protectedDisks), Optional.ToList(protectedNics), targetVmBiosId.Value, targetVmName.Value, hyperVGeneration, targetNetworkId.Value, testNetworkId.Value, Optional.ToNullable(targetCpuCores), Optional.ToNullable(isDynamicRam), dynamicMemoryConfig.Value, Optional.ToNullable(targetMemoryInMegaBytes), osType.Value, osName.Value, firmwareType.Value, fabricDiscoveryMachineId, sourceVmName.Value, Optional.ToNullable(sourceCpuCores), Optional.ToNullable(sourceMemoryInMegaBytes), runAsAccountId, sourceDraName, targetDraName, sourceApplianceName.Value, targetApplianceName.Value, failoverRecoveryPointId.Value, Optional.ToNullable(lastRecoveryPointReceived), lastRecoveryPointId.Value, Optional.ToNullable(initialReplicationProgressPercentage), Optional.ToNullable(migrationProgressPercentage), Optional.ToNullable(resumeProgressPercentage), Optional.ToNullable(resyncProgressPercentage), Optional.ToNullable(resyncRetryCount), Optional.ToNullable(resyncRequired), Optional.ToNullable(resyncState), Optional.ToNullable(performAutoResync), Optional.ToNullable(resumeRetryCount), Optional.ToNullable(lastReplicationUpdateTime)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs new file mode 100644 index 000000000000..5a47663b0791 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedItemModelCustomProperties.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHCIProtectedItemModelCustomProperties : ProtectedItemModelCustomProperties + { + /// Initializes a new instance of VMwareToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the run as account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// , , , , , , , , , , or is null. + public VMwareToAzStackHCIProtectedItemModelCustomProperties(string targetHciClusterId, string targetArcClusterCustomLocationId, string storageContainerId, string targetResourceGroupId, string customLocationRegion, IEnumerable disksToInclude, IEnumerable nicsToInclude, string hyperVGeneration, string fabricDiscoveryMachineId, string runAsAccountId, string sourceDraName, string targetDraName) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceDraName, nameof(sourceDraName)); + Argument.AssertNotNull(targetDraName, nameof(targetDraName)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + HyperVGeneration = hyperVGeneration; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + RunAsAccountId = runAsAccountId; + SourceDraName = sourceDraName; + TargetDraName = targetDraName; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedItemModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source DRA name. + /// Gets or sets the target DRA name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + internal VMwareToAzStackHCIProtectedItemModelCustomProperties(string instanceType, ProtectedItemActiveLocation? activeLocation, string targetHciClusterId, string targetArcClusterCustomLocationId, string targetAzStackHciClusterName, string storageContainerId, string targetResourceGroupId, string targetLocation, string customLocationRegion, IList disksToInclude, IList nicsToInclude, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, string targetVmName, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType, string osName, string firmwareType, string fabricDiscoveryMachineId, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string runAsAccountId, string sourceDraName, string targetDraName, string sourceApplianceName, string targetApplianceName, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceived, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? migrationProgressPercentage, int? resumeProgressPercentage, int? resyncProgressPercentage, long? resyncRetryCount, bool? resyncRequired, VMwareToAzureMigrateResyncState? resyncState, bool? performAutoResync, long? resumeRetryCount, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + TargetVmName = targetVmName; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceDraName = sourceDraName; + TargetDraName = targetDraName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceived = lastRecoveryPointReceived; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + MigrationProgressPercentage = migrationProgressPercentage; + ResumeProgressPercentage = resumeProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ResyncRetryCount = resyncRetryCount; + ResyncRequired = resyncRequired; + ResyncState = resyncState; + PerformAutoResync = performAutoResync; + ResumeRetryCount = resumeRetryCount; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public string TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public string TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the target storage container ARM Id. + public string StorageContainerId { get; set; } + /// Gets or sets the target resource group ARM Id. + public string TargetResourceGroupId { get; set; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the ARM Id of the discovered machine. + public string FabricDiscoveryMachineId { get; set; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the run as account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source DRA name. + public string SourceDraName { get; set; } + /// Gets or sets the target DRA name. + public string TargetDraName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceived { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// + /// Gets or sets the initial replication progress percentage. This is calculated based on + /// total bytes processed for all disks in the source VM. + /// + public int? InitialReplicationProgressPercentage { get; } + /// Gets or sets the migration progress percentage. + public int? MigrationProgressPercentage { get; } + /// Gets or sets the resume progress percentage. + public int? ResumeProgressPercentage { get; } + /// + /// Gets or sets the resync progress percentage. This is calculated based on total bytes + /// processed for all disks in the source VM. + /// + public int? ResyncProgressPercentage { get; } + /// Gets or sets the resync retry count. + public long? ResyncRetryCount { get; } + /// Gets or sets a value indicating whether resync is required. + public bool? ResyncRequired { get; } + /// Gets or sets the resync state. + public VMwareToAzureMigrateResyncState? ResyncState { get; } + /// Gets or sets a value indicating whether auto resync is to be done. + public bool? PerformAutoResync { get; set; } + /// Gets or sets the resume retry count. + public long? ResumeRetryCount { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..f80c3ae9055c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIProtectedNicProperties + { + internal static VMwareToAzStackHCIProtectedNicProperties DeserializeVMwareToAzStackHCIProtectedNicProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nicId = default; + Optional macAddress = default; + Optional label = default; + Optional isPrimaryNic = default; + Optional networkName = default; + Optional targetNetworkId = default; + Optional testNetworkId = default; + Optional selectionTypeForFailover = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPrimaryNic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPrimaryNic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + } + return new VMwareToAzStackHCIProtectedNicProperties(nicId.Value, macAddress.Value, label.Value, Optional.ToNullable(isPrimaryNic), networkName.Value, targetNetworkId.Value, testNetworkId.Value, Optional.ToNullable(selectionTypeForFailover)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs new file mode 100644 index 000000000000..5d513951e548 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIProtectedNicProperties.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHCIProtectedNicProperties + { + /// Initializes a new instance of VMwareToAzStackHCIProtectedNicProperties. + internal VMwareToAzStackHCIProtectedNicProperties() + { + } + + /// Initializes a new instance of VMwareToAzStackHCIProtectedNicProperties. + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + internal VMwareToAzStackHCIProtectedNicProperties(string nicId, string macAddress, string label, bool? isPrimaryNic, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover) + { + NicId = nicId; + MacAddress = macAddress; + Label = label; + IsPrimaryNic = isPrimaryNic; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the NIC label. + public string Label { get; } + /// Gets or sets a value indicating whether this is the primary NIC. + public bool? IsPrimaryNic { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..9cccf4e98588 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("vmwareFabricArmId"u8); + writer.WriteStringValue(VmwareFabricArmId); + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + writer.WriteEndObject(); + } + + internal static VMwareToAzStackHCIReplicationExtensionModelCustomProperties DeserializeVMwareToAzStackHCIReplicationExtensionModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmwareFabricArmId = default; + Optional vmwareSiteId = default; + string azStackHciFabricArmId = default; + Optional azStackHciSiteId = default; + Optional storageAccountId = default; + Optional storageAccountSasSecretName = default; + Optional asrServiceUri = default; + Optional rcmServiceUri = default; + Optional gatewayServiceUri = default; + Optional sourceGatewayServiceId = default; + Optional targetGatewayServiceId = default; + Optional sourceStorageContainerName = default; + Optional targetStorageContainerName = default; + Optional resourceLocation = default; + Optional subscriptionId = default; + Optional resourceGroup = default; + string instanceType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareFabricArmId"u8)) + { + vmwareFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asrServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rcmServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + } + return new VMwareToAzStackHCIReplicationExtensionModelCustomProperties(instanceType, vmwareFabricArmId, vmwareSiteId.Value, azStackHciFabricArmId, azStackHciSiteId.Value, storageAccountId.Value, storageAccountSasSecretName.Value, asrServiceUri.Value, rcmServiceUri.Value, gatewayServiceUri.Value, sourceGatewayServiceId.Value, targetGatewayServiceId.Value, sourceStorageContainerName.Value, targetStorageContainerName.Value, resourceLocation.Value, subscriptionId.Value, resourceGroup.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs new file mode 100644 index 000000000000..bb8a786ec7d3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzStackHCIReplicationExtensionModelCustomProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// VMware to AzStackHCI Replication extension model custom properties. + public partial class VMwareToAzStackHCIReplicationExtensionModelCustomProperties : ReplicationExtensionModelCustomProperties + { + /// Initializes a new instance of VMwareToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string vmwareFabricArmId, string azStackHciFabricArmId) + { + Argument.AssertNotNull(vmwareFabricArmId, nameof(vmwareFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + VmwareFabricArmId = vmwareFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of VMwareToAzStackHCIReplicationExtensionModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal VMwareToAzStackHCIReplicationExtensionModelCustomProperties(string instanceType, string vmwareFabricArmId, string vmwareSiteId, string azStackHciFabricArmId, string azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, Uri asrServiceUri, Uri rcmServiceUri, Uri gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType) + { + VmwareFabricArmId = vmwareFabricArmId; + VmwareSiteId = vmwareSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the ARM Id of the source VMware fabric. + public string VmwareFabricArmId { get; set; } + /// Gets or sets the ARM Id of the VMware site. + public string VmwareSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public string AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public string AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public Uri AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public Uri RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public Uri GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs new file mode 100644 index 000000000000..6c91c6df2229 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VMwareToAzureMigrateResyncState.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the resync state. + public readonly partial struct VMwareToAzureMigrateResyncState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VMwareToAzureMigrateResyncState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PreparedForResynchronizationValue = "PreparedForResynchronization"; + private const string StartedResynchronizationValue = "StartedResynchronization"; + + /// None. + public static VMwareToAzureMigrateResyncState None { get; } = new VMwareToAzureMigrateResyncState(NoneValue); + /// PreparedForResynchronization. + public static VMwareToAzureMigrateResyncState PreparedForResynchronization { get; } = new VMwareToAzureMigrateResyncState(PreparedForResynchronizationValue); + /// StartedResynchronization. + public static VMwareToAzureMigrateResyncState StartedResynchronization { get; } = new VMwareToAzureMigrateResyncState(StartedResynchronizationValue); + /// Determines if two values are the same. + public static bool operator ==(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VMwareToAzureMigrateResyncState(string value) => new VMwareToAzureMigrateResyncState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VMwareToAzureMigrateResyncState other && Equals(other); + /// + public bool Equals(VMwareToAzureMigrateResyncState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.Serialization.cs new file mode 100644 index 000000000000..b45d58055185 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class VaultModelCollection + { + internal static VaultModelCollection DeserializeVaultModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(VaultModelData.DeserializeVaultModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new VaultModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.cs new file mode 100644 index 000000000000..e82da96f394d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Vault model collection. + internal partial class VaultModelCollection + { + /// Initializes a new instance of VaultModelCollection. + internal VaultModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of VaultModelCollection. + /// Gets or sets the list of vaults. + /// Gets or sets the value of next link. + internal VaultModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of vaults. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelData.Serialization.cs new file mode 100644 index 000000000000..72842ad9424d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelData.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class VaultModelData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WriteEndObject(); + } + + internal static VaultModelData DeserializeVaultModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional properties = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = VaultModelProperties.DeserializeVaultModelProperties(property.Value); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new VaultModelData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.Serialization.cs new file mode 100644 index 000000000000..5cd2c81a00c7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VaultModelPatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.cs new file mode 100644 index 000000000000..8a1970579f87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelPatch.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Vault model for update. + public partial class VaultModelPatch : ResourceData + { + /// Initializes a new instance of VaultModelPatch. + public VaultModelPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Vault properties. + public VaultModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.Serialization.cs new file mode 100644 index 000000000000..9514f1fdc766 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class VaultModelProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(VaultType)) + { + writer.WritePropertyName("vaultType"u8); + writer.WriteStringValue(VaultType.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static VaultModelProperties DeserializeVaultModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional provisioningState = default; + Optional serviceResourceId = default; + Optional vaultType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + serviceResourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vaultType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vaultType = new ReplicationVaultType(property.Value.GetString()); + continue; + } + } + return new VaultModelProperties(Optional.ToNullable(provisioningState), serviceResourceId.Value, Optional.ToNullable(vaultType)); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.cs new file mode 100644 index 000000000000..1d9b326c870e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VaultModelProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Vault properties. + public partial class VaultModelProperties + { + /// Initializes a new instance of VaultModelProperties. + public VaultModelProperties() + { + } + + /// Initializes a new instance of VaultModelProperties. + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + internal VaultModelProperties(ProvisioningState? provisioningState, string serviceResourceId, ReplicationVaultType? vaultType) + { + ProvisioningState = provisioningState; + ServiceResourceId = serviceResourceId; + VaultType = vaultType; + } + + /// Gets or sets the provisioning state of the vault. + public ProvisioningState? ProvisioningState { get; } + /// Gets or sets the service resource Id. + public string ServiceResourceId { get; } + /// Gets or sets the type of vault. + public ReplicationVaultType? VaultType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VmNicSelection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VmNicSelection.cs new file mode 100644 index 000000000000..2bbac94ae022 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/VmNicSelection.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.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the selection type of the NIC. + public readonly partial struct VmNicSelection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmNicSelection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSelectedValue = "NotSelected"; + private const string SelectedByUserValue = "SelectedByUser"; + private const string SelectedByDefaultValue = "SelectedByDefault"; + private const string SelectedByUserOverrideValue = "SelectedByUserOverride"; + + /// NotSelected. + public static VmNicSelection NotSelected { get; } = new VmNicSelection(NotSelectedValue); + /// SelectedByUser. + public static VmNicSelection SelectedByUser { get; } = new VmNicSelection(SelectedByUserValue); + /// SelectedByDefault. + public static VmNicSelection SelectedByDefault { get; } = new VmNicSelection(SelectedByDefaultValue); + /// SelectedByUserOverride. + public static VmNicSelection SelectedByUserOverride { get; } = new VmNicSelection(SelectedByUserOverrideValue); + /// Determines if two values are the same. + public static bool operator ==(VmNicSelection left, VmNicSelection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmNicSelection left, VmNicSelection right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VmNicSelection(string value) => new VmNicSelection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmNicSelection other && Equals(other); + /// + public bool Equals(VmNicSelection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.Serialization.cs new file mode 100644 index 000000000000..8d49f16ce33a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + internal partial class WorkflowModelCollection + { + internal static WorkflowModelCollection DeserializeWorkflowModelCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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(WorkflowModelData.DeserializeWorkflowModelData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new WorkflowModelCollection(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.cs new file mode 100644 index 000000000000..81f8bb6fc074 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCollection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Recoveryservicesdatareplication; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Workflow model collection. + internal partial class WorkflowModelCollection + { + /// Initializes a new instance of WorkflowModelCollection. + internal WorkflowModelCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of WorkflowModelCollection. + /// Gets or sets the list of workflows. + /// Gets or sets the value of next link. + internal WorkflowModelCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Gets or sets the list of workflows. + public IReadOnlyList Value { get; } + /// Gets or sets the value of next link. + public string NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d5cb7bf7efd9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class WorkflowModelCustomProperties + { + internal static WorkflowModelCustomProperties DeserializeWorkflowModelCustomProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FailoverWorkflowDetails": return FailoverWorkflowModelCustomProperties.DeserializeFailoverWorkflowModelCustomProperties(element); + case "TestFailoverCleanupWorkflowDetails": return TestFailoverCleanupWorkflowModelCustomProperties.DeserializeTestFailoverCleanupWorkflowModelCustomProperties(element); + case "TestFailoverWorkflowDetails": return TestFailoverWorkflowModelCustomProperties.DeserializeTestFailoverWorkflowModelCustomProperties(element); + } + } + return UnknownWorkflowModelCustomProperties.DeserializeUnknownWorkflowModelCustomProperties(element); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.cs new file mode 100644 index 000000000000..1ff7134e328e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelCustomProperties.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// + /// Workflow model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class WorkflowModelCustomProperties + { + /// Initializes a new instance of WorkflowModelCustomProperties. + protected WorkflowModelCustomProperties() + { + AffectedObjectDetails = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of WorkflowModelCustomProperties. + /// Gets or sets the instance type. + /// Gets or sets any custom properties of the affected object. + internal WorkflowModelCustomProperties(string instanceType, IReadOnlyDictionary affectedObjectDetails) + { + InstanceType = instanceType; + AffectedObjectDetails = affectedObjectDetails; + } + + /// Gets or sets the instance type. + internal string InstanceType { get; set; } + /// Gets or sets any custom properties of the affected object. + public IReadOnlyDictionary AffectedObjectDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelData.Serialization.cs new file mode 100644 index 000000000000..bab0dde5cb3b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelData.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + public partial class WorkflowModelData + { + internal static WorkflowModelData DeserializeWorkflowModelData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WorkflowModelProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = WorkflowModelProperties.DeserializeWorkflowModelProperties(property.Value); + 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; + } + } + return new WorkflowModelData(id, name, type, systemData.Value, properties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.Serialization.cs new file mode 100644 index 000000000000..b86695aa335d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + public partial class WorkflowModelProperties + { + internal static WorkflowModelProperties DeserializeWorkflowModelProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional displayName = default; + Optional state = default; + Optional startTime = default; + Optional endTime = default; + Optional objectId = default; + Optional objectName = default; + Optional objectInternalId = default; + Optional objectInternalName = default; + Optional objectType = default; + Optional replicationProviderId = default; + Optional sourceFabricProviderId = default; + Optional targetFabricProviderId = default; + Optional> allowedActions = default; + Optional activityId = default; + Optional> tasks = default; + Optional> errors = default; + WorkflowModelCustomProperties customProperties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new WorkflowState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectName"u8)) + { + objectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalId"u8)) + { + objectInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalName"u8)) + { + objectInternalName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectType = new WorkflowObjectType(property.Value.GetString()); + continue; + } + if (property.NameEquals("replicationProviderId"u8)) + { + replicationProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedActions = array; + continue; + } + if (property.NameEquals("activityId"u8)) + { + activityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TaskModel.DeserializeTaskModel(item)); + } + tasks = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ErrorModel.DeserializeErrorModel(item)); + } + errors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = WorkflowModelCustomProperties.DeserializeWorkflowModelCustomProperties(property.Value); + continue; + } + } + return new WorkflowModelProperties(displayName.Value, Optional.ToNullable(state), Optional.ToNullable(startTime), Optional.ToNullable(endTime), objectId.Value, objectName.Value, objectInternalId.Value, objectInternalName.Value, Optional.ToNullable(objectType), replicationProviderId.Value, sourceFabricProviderId.Value, targetFabricProviderId.Value, Optional.ToList(allowedActions), activityId.Value, Optional.ToList(tasks), Optional.ToList(errors), customProperties); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.cs new file mode 100644 index 000000000000..afb854a9e1d9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowModelProperties.cs @@ -0,0 +1,116 @@ +// 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.Recoveryservicesdatareplication.Models +{ + /// Workflow model properties. + public partial class WorkflowModelProperties + { + /// Initializes a new instance of WorkflowModelProperties. + /// + /// Workflow model custom properties. + /// 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 . + /// + /// is null. + internal WorkflowModelProperties(WorkflowModelCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + AllowedActions = new ChangeTrackingList(); + Tasks = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of WorkflowModelProperties. + /// Gets or sets the friendly display name. + /// Gets or sets the workflow state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the workflow. + /// Gets or sets the workflow activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Workflow model custom properties. + /// 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 . + /// + internal WorkflowModelProperties(string displayName, WorkflowState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, string objectId, string objectName, string objectInternalId, string objectInternalName, WorkflowObjectType? objectType, string replicationProviderId, string sourceFabricProviderId, string targetFabricProviderId, IReadOnlyList allowedActions, string activityId, IReadOnlyList tasks, IReadOnlyList errors, WorkflowModelCustomProperties customProperties) + { + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + ObjectId = objectId; + ObjectName = objectName; + ObjectInternalId = objectInternalId; + ObjectInternalName = objectInternalName; + ObjectType = objectType; + ReplicationProviderId = replicationProviderId; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + AllowedActions = allowedActions; + ActivityId = activityId; + Tasks = tasks; + Errors = errors; + CustomProperties = customProperties; + } + + /// Gets or sets the friendly display name. + public string DisplayName { get; } + /// Gets or sets the workflow state. + public WorkflowState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Gets or sets the affected object Id. + public string ObjectId { get; } + /// Gets or sets the affected object name. + public string ObjectName { get; } + /// Gets or sets the affected object internal Id. + public string ObjectInternalId { get; } + /// Gets or sets the affected object internal name. + public string ObjectInternalName { get; } + /// Gets or sets the object type. + public WorkflowObjectType? ObjectType { get; } + /// Gets or sets the replication provider. + public string ReplicationProviderId { get; } + /// Gets or sets the source fabric provider. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider. + public string TargetFabricProviderId { get; } + /// Gets or sets the list of allowed actions on the workflow. + public IReadOnlyList AllowedActions { get; } + /// Gets or sets the workflow activity id. + public string ActivityId { get; } + /// Gets or sets the list of tasks. + public IReadOnlyList Tasks { get; } + /// Gets or sets the list of errors. + public IReadOnlyList Errors { get; } + /// + /// Workflow model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public WorkflowModelCustomProperties CustomProperties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowObjectType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowObjectType.cs new file mode 100644 index 000000000000..fd2960798e3b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowObjectType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the object type. + public readonly partial struct WorkflowObjectType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WorkflowObjectType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvsDiskPoolValue = "AvsDiskPool"; + private const string DraValue = "Dra"; + private const string FabricValue = "Fabric"; + private const string PolicyValue = "Policy"; + private const string ProtectedItemValue = "ProtectedItem"; + private const string RecoveryPlanValue = "RecoveryPlan"; + private const string ReplicationExtensionValue = "ReplicationExtension"; + private const string VaultValue = "Vault"; + + /// AvsDiskPool. + public static WorkflowObjectType AvsDiskPool { get; } = new WorkflowObjectType(AvsDiskPoolValue); + /// Dra. + public static WorkflowObjectType Dra { get; } = new WorkflowObjectType(DraValue); + /// Fabric. + public static WorkflowObjectType Fabric { get; } = new WorkflowObjectType(FabricValue); + /// Policy. + public static WorkflowObjectType Policy { get; } = new WorkflowObjectType(PolicyValue); + /// ProtectedItem. + public static WorkflowObjectType ProtectedItem { get; } = new WorkflowObjectType(ProtectedItemValue); + /// RecoveryPlan. + public static WorkflowObjectType RecoveryPlan { get; } = new WorkflowObjectType(RecoveryPlanValue); + /// ReplicationExtension. + public static WorkflowObjectType ReplicationExtension { get; } = new WorkflowObjectType(ReplicationExtensionValue); + /// Vault. + public static WorkflowObjectType Vault { get; } = new WorkflowObjectType(VaultValue); + /// Determines if two values are the same. + public static bool operator ==(WorkflowObjectType left, WorkflowObjectType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WorkflowObjectType left, WorkflowObjectType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WorkflowObjectType(string value) => new WorkflowObjectType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WorkflowObjectType other && Equals(other); + /// + public bool Equals(WorkflowObjectType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowState.cs new file mode 100644 index 000000000000..df9f956b951c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/Models/WorkflowState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Models +{ + /// Gets or sets the workflow state. + public readonly partial struct WorkflowState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WorkflowState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string CancellingValue = "Cancelling"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string CompletedWithInformationValue = "CompletedWithInformation"; + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string CompletedWithErrorsValue = "CompletedWithErrors"; + + /// Pending. + public static WorkflowState Pending { get; } = new WorkflowState(PendingValue); + /// Started. + public static WorkflowState Started { get; } = new WorkflowState(StartedValue); + /// Cancelling. + public static WorkflowState Cancelling { get; } = new WorkflowState(CancellingValue); + /// Succeeded. + public static WorkflowState Succeeded { get; } = new WorkflowState(SucceededValue); + /// Failed. + public static WorkflowState Failed { get; } = new WorkflowState(FailedValue); + /// Cancelled. + public static WorkflowState Cancelled { get; } = new WorkflowState(CancelledValue); + /// CompletedWithInformation. + public static WorkflowState CompletedWithInformation { get; } = new WorkflowState(CompletedWithInformationValue); + /// CompletedWithWarnings. + public static WorkflowState CompletedWithWarnings { get; } = new WorkflowState(CompletedWithWarningsValue); + /// CompletedWithErrors. + public static WorkflowState CompletedWithErrors { get; } = new WorkflowState(CompletedWithErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(WorkflowState left, WorkflowState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WorkflowState left, WorkflowState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WorkflowState(string value) => new WorkflowState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WorkflowState other && Equals(other); + /// + public bool Equals(WorkflowState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelCollection.cs new file mode 100644 index 000000000000..5884378f0275 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelCollection.cs @@ -0,0 +1,341 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetPolicyModels method from an instance of . + /// + public partial class PolicyModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _policyModelPolicyClientDiagnostics; + private readonly PolicyRestOperations _policyModelPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected PolicyModelCollection() + { + } + + /// 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 PolicyModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _policyModelPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", PolicyModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PolicyModelResource.ResourceType, out string policyModelPolicyApiVersion); + _policyModelPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, policyModelPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Create + /// + /// + /// + /// 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 policy name. + /// Policy model. + /// 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 policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Create + /// + /// + /// + /// 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 policy name. + /// Policy model. + /// 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 policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, 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 the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy 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 policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Get"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Get"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// Policy_List + /// + /// + /// + /// 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) => _policyModelPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _policyModelPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PolicyModelResource(Client, PolicyModelData.DeserializePolicyModelData(e)), _policyModelPolicyClientDiagnostics, Pipeline, "PolicyModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// Policy_List + /// + /// + /// + /// 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) => _policyModelPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _policyModelPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PolicyModelResource(Client, PolicyModelData.DeserializePolicyModelData(e)), _policyModelPolicyClientDiagnostics, Pipeline, "PolicyModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy 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 policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Exists"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, 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.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelCollection.Exists"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelData.cs new file mode 100644 index 000000000000..dffc8e28d0f4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the PolicyModel data model. + /// Policy model. + /// + public partial class PolicyModelData : ResourceData + { + /// Initializes a new instance of PolicyModelData. + /// Policy model properties. + /// is null. + public PolicyModelData(PolicyModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of PolicyModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Policy model properties. + internal PolicyModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PolicyModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Policy model properties. + public PolicyModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelResource.cs new file mode 100644 index 000000000000..a923c244b77d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/PolicyModelResource.cs @@ -0,0 +1,372 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a PolicyModel 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 GetPolicyModelResource method. + /// Otherwise you can get one from its parent resource using the GetPolicyModel method. + /// + public partial class PolicyModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _policyModelPolicyClientDiagnostics; + private readonly PolicyRestOperations _policyModelPolicyRestClient; + private readonly ClientDiagnostics _policyOperationStatusClientDiagnostics; + private readonly PolicyOperationStatusRestOperations _policyOperationStatusRestClient; + private readonly PolicyModelData _data; + + /// Initializes a new instance of the class for mocking. + protected PolicyModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PolicyModelResource(ArmClient client, PolicyModelData 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 PolicyModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _policyModelPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string policyModelPolicyApiVersion); + _policyModelPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, policyModelPolicyApiVersion); + _policyOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _policyOperationStatusRestClient = new PolicyOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationPolicies"; + + /// 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 PolicyModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Get"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Get"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PolicyModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Delete + /// + /// + /// + /// 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 = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Delete"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Delete + /// + /// + /// + /// 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 = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Delete"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Create + /// + /// + /// + /// 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. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Update"); + scope.Start(); + try + { + var response = await _policyModelPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Create + /// + /// + /// + /// 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. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _policyModelPolicyClientDiagnostics.CreateScope("PolicyModelResource.Update"); + scope.Start(); + try + { + var response = _policyModelPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new PolicyModelOperationSource(Client), _policyModelPolicyClientDiagnostics, Pipeline, _policyModelPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Tracks the results of an asynchronous operation on the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}/operations/{operationId} + /// + /// + /// Operation Id + /// PolicyOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetPolicyOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _policyOperationStatusClientDiagnostics.CreateScope("PolicyModelResource.GetPolicyOperationStatu"); + scope.Start(); + try + { + var response = await _policyOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}/operations/{operationId} + /// + /// + /// Operation Id + /// PolicyOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetPolicyOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _policyOperationStatusClientDiagnostics.CreateScope("PolicyModelResource.GetPolicyOperationStatu"); + scope.Start(); + try + { + var response = _policyOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelCollection.cs new file mode 100644 index 000000000000..26f3ae705c27 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelCollection.cs @@ -0,0 +1,341 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetProtectedItemModels method from an instance of . + /// + public partial class ProtectedItemModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _protectedItemModelProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _protectedItemModelProtectedItemRestClient; + + /// Initializes a new instance of the class for mocking. + protected ProtectedItemModelCollection() + { + } + + /// 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 ProtectedItemModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _protectedItemModelProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProtectedItemModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ProtectedItemModelResource.ResourceType, out string protectedItemModelProtectedItemApiVersion); + _protectedItemModelProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, protectedItemModelProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Create + /// + /// + /// + /// 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 protected item name. + /// Protected item model. + /// 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 protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Create + /// + /// + /// + /// 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 protected item name. + /// Protected item model. + /// 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 protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, 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 the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item 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 protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Get"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Get"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItem_List + /// + /// + /// + /// 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) => _protectedItemModelProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _protectedItemModelProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProtectedItemModelResource(Client, ProtectedItemModelData.DeserializeProtectedItemModelData(e)), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, "ProtectedItemModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItem_List + /// + /// + /// + /// 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) => _protectedItemModelProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _protectedItemModelProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProtectedItemModelResource(Client, ProtectedItemModelData.DeserializeProtectedItemModelData(e)), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, "ProtectedItemModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item 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 protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Exists"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelCollection.Exists"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelData.cs new file mode 100644 index 000000000000..89f0675e54a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the ProtectedItemModel data model. + /// Protected item model. + /// + public partial class ProtectedItemModelData : ResourceData + { + /// Initializes a new instance of ProtectedItemModelData. + /// Protected item model properties. + /// is null. + public ProtectedItemModelData(ProtectedItemModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of ProtectedItemModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + internal ProtectedItemModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProtectedItemModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Protected item model properties. + public ProtectedItemModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelResource.cs new file mode 100644 index 000000000000..af4312b5ff77 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProtectedItemModelResource.cs @@ -0,0 +1,497 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a ProtectedItemModel 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 GetProtectedItemModelResource method. + /// Otherwise you can get one from its parent resource using the GetProtectedItemModel method. + /// + public partial class ProtectedItemModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _protectedItemModelProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _protectedItemModelProtectedItemRestClient; + private readonly ClientDiagnostics _protectedItemOperationStatusClientDiagnostics; + private readonly ProtectedItemOperationStatusRestOperations _protectedItemOperationStatusRestClient; + private readonly ProtectedItemModelData _data; + + /// Initializes a new instance of the class for mocking. + protected ProtectedItemModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ProtectedItemModelResource(ArmClient client, ProtectedItemModelData 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 ProtectedItemModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _protectedItemModelProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string protectedItemModelProtectedItemApiVersion); + _protectedItemModelProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, protectedItemModelProtectedItemApiVersion); + _protectedItemOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _protectedItemOperationStatusRestClient = new ProtectedItemOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems"; + + /// 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 ProtectedItemModelData 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 RecoveryPointModelResources in the ProtectedItemModel. + /// An object representing collection of RecoveryPointModelResources and their operations over a RecoveryPointModelResource. + public virtual RecoveryPointModelCollection GetRecoveryPointModels() + { + return GetCachedClient(Client => new RecoveryPointModelCollection(Client, Id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRecoveryPointModelAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + return await GetRecoveryPointModels().GetAsync(recoveryPointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRecoveryPointModel(string recoveryPointName, CancellationToken cancellationToken = default) + { + return GetRecoveryPointModels().Get(recoveryPointName, cancellationToken); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Get"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Get"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProtectedItemModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Delete + /// + /// + /// + /// 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. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Delete"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Delete + /// + /// + /// + /// 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. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Delete"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Create + /// + /// + /// + /// 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. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Update"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Create + /// + /// + /// + /// 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. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.Update"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new ProtectedItemModelOperationSource(Client), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// + /// 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. + /// Planned failover model. + /// The cancellation token to use. + public virtual async Task> PlannedFailoverAsync(WaitUntil waitUntil, PlannedFailoverModel body = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.PlannedFailover"); + scope.Start(); + try + { + var response = await _protectedItemModelProtectedItemRestClient.PlannedFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new PlannedFailoverModelOperationSource(), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// + /// 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. + /// Planned failover model. + /// The cancellation token to use. + public virtual ArmOperation PlannedFailover(WaitUntil waitUntil, PlannedFailoverModel body = null, CancellationToken cancellationToken = default) + { + using var scope = _protectedItemModelProtectedItemClientDiagnostics.CreateScope("ProtectedItemModelResource.PlannedFailover"); + scope.Start(); + try + { + var response = _protectedItemModelProtectedItemRestClient.PlannedFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new PlannedFailoverModelOperationSource(), _protectedItemModelProtectedItemClientDiagnostics, Pipeline, _protectedItemModelProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/operations/{operationId} + /// + /// + /// Operation Id + /// ProtectedItemOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetProtectedItemOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _protectedItemOperationStatusClientDiagnostics.CreateScope("ProtectedItemModelResource.GetProtectedItemOperationStatu"); + scope.Start(); + try + { + var response = await _protectedItemOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/operations/{operationId} + /// + /// + /// Operation Id + /// ProtectedItemOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetProtectedItemOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _protectedItemOperationStatusClientDiagnostics.CreateScope("ProtectedItemModelResource.GetProtectedItemOperationStatu"); + scope.Start(); + try + { + var response = _protectedItemOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProviderConstants.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c00f94ff38b9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelCollection.cs new file mode 100644 index 000000000000..3781ae9246bb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelCollection.cs @@ -0,0 +1,259 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetRecoveryPointModels method from an instance of . + /// + public partial class RecoveryPointModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _recoveryPointModelRecoveryPointsClientDiagnostics; + private readonly RecoveryPointsRestOperations _recoveryPointModelRecoveryPointsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RecoveryPointModelCollection() + { + } + + /// 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 RecoveryPointModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryPointModelRecoveryPointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", RecoveryPointModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RecoveryPointModelResource.ResourceType, out string recoveryPointModelRecoveryPointsApiVersion); + _recoveryPointModelRecoveryPointsRestClient = new RecoveryPointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryPointModelRecoveryPointsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProtectedItemModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProtectedItemModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// 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 = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelCollection.Get"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// 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 = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelCollection.Get"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPoints_List + /// + /// + /// + /// 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) => _recoveryPointModelRecoveryPointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryPointModelRecoveryPointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RecoveryPointModelResource(Client, RecoveryPointModelData.DeserializeRecoveryPointModelData(e)), _recoveryPointModelRecoveryPointsClientDiagnostics, Pipeline, "RecoveryPointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPoints_List + /// + /// + /// + /// 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) => _recoveryPointModelRecoveryPointsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _recoveryPointModelRecoveryPointsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RecoveryPointModelResource(Client, RecoveryPointModelData.DeserializeRecoveryPointModelData(e)), _recoveryPointModelRecoveryPointsClientDiagnostics, Pipeline, "RecoveryPointModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// 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 = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelCollection.Exists"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// 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 = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelCollection.Exists"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelData.cs new file mode 100644 index 000000000000..b49aa766a4d6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the RecoveryPointModel data model. + /// Recovery point model. + /// + public partial class RecoveryPointModelData : ResourceData + { + /// Initializes a new instance of RecoveryPointModelData. + /// Recovery point model properties. + /// is null. + internal RecoveryPointModelData(RecoveryPointModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of RecoveryPointModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Recovery point model properties. + internal RecoveryPointModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RecoveryPointModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Recovery point model properties. + public RecoveryPointModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelResource.cs new file mode 100644 index 000000000000..1fcf91837801 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RecoveryPointModelResource.cs @@ -0,0 +1,153 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a RecoveryPointModel 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 GetRecoveryPointModelResource method. + /// Otherwise you can get one from its parent resource using the GetRecoveryPointModel method. + /// + public partial class RecoveryPointModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _recoveryPointModelRecoveryPointsClientDiagnostics; + private readonly RecoveryPointsRestOperations _recoveryPointModelRecoveryPointsRestClient; + private readonly RecoveryPointModelData _data; + + /// Initializes a new instance of the class for mocking. + protected RecoveryPointModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RecoveryPointModelResource(ArmClient client, RecoveryPointModelData 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 RecoveryPointModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _recoveryPointModelRecoveryPointsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string recoveryPointModelRecoveryPointsApiVersion); + _recoveryPointModelRecoveryPointsRestClient = new RecoveryPointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, recoveryPointModelRecoveryPointsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems/recoveryPoints"; + + /// 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 RecoveryPointModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelResource.Get"); + scope.Start(); + try + { + var response = await _recoveryPointModelRecoveryPointsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPoints_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _recoveryPointModelRecoveryPointsClientDiagnostics.CreateScope("RecoveryPointModelResource.Get"); + scope.Start(); + try + { + var response = _recoveryPointModelRecoveryPointsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RecoveryPointModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelCollection.cs new file mode 100644 index 000000000000..18d5632ad301 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelCollection.cs @@ -0,0 +1,341 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetReplicationExtensionModels method from an instance of . + /// + public partial class ReplicationExtensionModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _replicationExtensionModelReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _replicationExtensionModelReplicationExtensionRestClient; + + /// Initializes a new instance of the class for mocking. + protected ReplicationExtensionModelCollection() + { + } + + /// 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 ReplicationExtensionModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicationExtensionModelReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ReplicationExtensionModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ReplicationExtensionModelResource.ResourceType, out string replicationExtensionModelReplicationExtensionApiVersion); + _replicationExtensionModelReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicationExtensionModelReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Create + /// + /// + /// + /// 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 replication extension name. + /// Replication extension model. + /// 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 replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Create + /// + /// + /// + /// 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 replication extension name. + /// Replication extension model. + /// 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 replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, 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 the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension 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 replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Get"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Get"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtension_List + /// + /// + /// + /// 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) => _replicationExtensionModelReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicationExtensionModelReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReplicationExtensionModelResource(Client, ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(e)), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, "ReplicationExtensionModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtension_List + /// + /// + /// + /// 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) => _replicationExtensionModelReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicationExtensionModelReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicationExtensionModelResource(Client, ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(e)), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, "ReplicationExtensionModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension 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 replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Exists"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, 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.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelCollection.Exists"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelData.cs new file mode 100644 index 000000000000..cec208dabc11 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the ReplicationExtensionModel data model. + /// Replication extension model. + /// + public partial class ReplicationExtensionModelData : ResourceData + { + /// Initializes a new instance of ReplicationExtensionModelData. + /// Replication extension model properties. + /// is null. + public ReplicationExtensionModelData(ReplicationExtensionModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of ReplicationExtensionModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Replication extension model properties. + internal ReplicationExtensionModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ReplicationExtensionModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Replication extension model properties. + public ReplicationExtensionModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelResource.cs new file mode 100644 index 000000000000..9dc38b7c3772 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/ReplicationExtensionModelResource.cs @@ -0,0 +1,372 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a ReplicationExtensionModel 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 GetReplicationExtensionModelResource method. + /// Otherwise you can get one from its parent resource using the GetReplicationExtensionModel method. + /// + public partial class ReplicationExtensionModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _replicationExtensionModelReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _replicationExtensionModelReplicationExtensionRestClient; + private readonly ClientDiagnostics _replicationExtensionOperationStatusClientDiagnostics; + private readonly ReplicationExtensionOperationStatusRestOperations _replicationExtensionOperationStatusRestClient; + private readonly ReplicationExtensionModelData _data; + + /// Initializes a new instance of the class for mocking. + protected ReplicationExtensionModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ReplicationExtensionModelResource(ArmClient client, ReplicationExtensionModelData 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 ReplicationExtensionModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicationExtensionModelReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string replicationExtensionModelReplicationExtensionApiVersion); + _replicationExtensionModelReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicationExtensionModelReplicationExtensionApiVersion); + _replicationExtensionOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _replicationExtensionOperationStatusRestClient = new ReplicationExtensionOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationExtensions"; + + /// 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 ReplicationExtensionModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Get"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Get"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicationExtensionModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Delete + /// + /// + /// + /// 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 = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Delete"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Delete + /// + /// + /// + /// 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 = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Delete"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Create + /// + /// + /// + /// 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 extension model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Update"); + scope.Start(); + try + { + var response = await _replicationExtensionModelReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Create + /// + /// + /// + /// 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 extension model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicationExtensionModelReplicationExtensionClientDiagnostics.CreateScope("ReplicationExtensionModelResource.Update"); + scope.Start(); + try + { + var response = _replicationExtensionModelReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new ReplicationExtensionModelOperationSource(Client), _replicationExtensionModelReplicationExtensionClientDiagnostics, Pipeline, _replicationExtensionModelReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Tracks the results of an asynchronous operation on the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}/operations/{operationId} + /// + /// + /// Operation Id + /// ReplicationExtensionOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetReplicationExtensionOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _replicationExtensionOperationStatusClientDiagnostics.CreateScope("ReplicationExtensionModelResource.GetReplicationExtensionOperationStatu"); + scope.Start(); + try + { + var response = await _replicationExtensionOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}/operations/{operationId} + /// + /// + /// Operation Id + /// ReplicationExtensionOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetReplicationExtensionOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _replicationExtensionOperationStatusClientDiagnostics.CreateScope("ReplicationExtensionModelResource.GetReplicationExtensionOperationStatu"); + scope.Start(); + try + { + var response = _replicationExtensionOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/AzureSiteRecoveryManagementServiceAPIRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/AzureSiteRecoveryManagementServiceAPIRestOperations.cs new file mode 100644 index 000000000000..07085c7efb55 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/AzureSiteRecoveryManagementServiceAPIRestOperations.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class AzureSiteRecoveryManagementServiceAPIRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AzureSiteRecoveryManagementServiceAPIRestOperations. + /// 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 AzureSiteRecoveryManagementServiceAPIRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckNameAvailabilityAsync(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, location, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseModel value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CheckNameAvailabilityResponseModel.DeserializeCheckNameAvailabilityResponseModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckNameAvailability(string subscriptionId, AzureLocation location, CheckNameAvailabilityModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, location, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseModel value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CheckNameAvailabilityResponseModel.DeserializeCheckNameAvailabilityResponseModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeploymentPreflightRequest(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/preflight", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Performs resource deployment validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> DeploymentPreflightAsync(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreateDeploymentPreflightRequest(subscriptionId, resourceGroupName, deploymentId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflightModel value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentPreflightModel.DeserializeDeploymentPreflightModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs resource deployment validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response DeploymentPreflight(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflightModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreateDeploymentPreflightRequest(subscriptionId, resourceGroupName, deploymentId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflightModel value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentPreflightModel.DeserializeDeploymentPreflightModel(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraOperationStatusRestOperations.cs new file mode 100644 index 000000000000..1581ac9adccc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraOperationStatusRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class DraOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DraOperationStatusRestOperations. + /// 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 DraOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, string operationId) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// The ID of an ongoing async operation. + /// 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 fabricName, string fabricAgentName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// The ID of an ongoing async operation. + /// 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 fabricName, string fabricAgentName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraRestOperations.cs new file mode 100644 index 000000000000..8ee0d4b80f54 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/DraRestOperations.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class DraRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DraRestOperations. + /// 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 DraRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, 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 the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) 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 fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DraModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DraModelData.DeserializeDraModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DraModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) 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 fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DraModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DraModelData.DeserializeDraModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DraModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DraModelData 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// Dra model. + /// 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 fabricName, string fabricAgentName, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// Dra model. + /// 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 fabricName, string fabricAgentName, DraModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent (Dra) name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents", 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 fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.DraModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.DraModelCollection.DeserializeDraModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.DraModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.DraModelCollection.DeserializeDraModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + 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 fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.DraModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.DraModelCollection.DeserializeDraModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.DraModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.DraModelCollection.DeserializeDraModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs new file mode 100644 index 000000000000..95e794daaf48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class EmailConfigurationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EmailConfigurationRestOperations. + /// 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 EmailConfigurationRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, 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 the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration 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 vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EmailConfigurationModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration 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 vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EmailConfigurationModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, EmailConfigurationModelData 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// 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 vaultName, string emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + EmailConfigurationModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// 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 vaultName, string emailConfigurationName, EmailConfigurationModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + EmailConfigurationModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EmailConfigurationModelData.DeserializeEmailConfigurationModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings", 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 alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.EmailConfigurationModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.EmailConfigurationModelCollection.DeserializeEmailConfigurationModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.EmailConfigurationModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.EmailConfigurationModelCollection.DeserializeEmailConfigurationModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + 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 alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.EmailConfigurationModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.EmailConfigurationModelCollection.DeserializeEmailConfigurationModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.EmailConfigurationModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.EmailConfigurationModelCollection.DeserializeEmailConfigurationModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EventRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EventRestOperations.cs new file mode 100644 index 000000000000..1602a999938d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/EventRestOperations.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class EventRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EventRestOperations. + /// 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 EventRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events/", false); + uri.AppendPath(eventName, 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 the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event 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 vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventModelData.DeserializeEventModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event 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 vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventModelData.DeserializeEventModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string filter, string continuationToken) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.EventModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.EventModelCollection.DeserializeEventModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.EventModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.EventModelCollection.DeserializeEventModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string filter, string continuationToken) + { + 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 events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.EventModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.EventModelCollection.DeserializeEventModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.EventModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.EventModelCollection.DeserializeEventModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricOperationsStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricOperationsStatusRestOperations.cs new file mode 100644 index 000000000000..d794318495ee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricOperationsStatusRestOperations.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class FabricOperationsStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricOperationsStatusRestOperations. + /// 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 FabricOperationsStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName, string operationId) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The ID of an ongoing async operation. + /// 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 fabricName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The ID of an ongoing async operation. + /// 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 fabricName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricRestOperations.cs new file mode 100644 index 000000000000..3f4ae7fdb949 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/FabricRestOperations.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class FabricRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricRestOperations. + /// 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 FabricRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, 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 the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric 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 fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FabricModelData.DeserializeFabricModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric 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 fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FabricModelData.DeserializeFabricModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FabricModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, FabricModelData 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// 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 fabricName, FabricModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fabricName, FabricModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + 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.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + 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.DataReplication/replicationFabrics", false); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string continuationToken) + { + 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 fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + 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 fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.FabricModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.FabricModelCollection.DeserializeFabricModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyOperationStatusRestOperations.cs new file mode 100644 index 000000000000..84856bdaca9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyOperationStatusRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class PolicyOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PolicyOperationStatusRestOperations. + /// 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 PolicyOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName, string operationId) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string policyName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string policyName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyRestOperations.cs new file mode 100644 index 000000000000..5c5b0479c042 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/PolicyRestOperations.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class PolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PolicyRestOperations. + /// 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 PolicyRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, 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 the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy 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 vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PolicyModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy 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 vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PolicyModelData.DeserializePolicyModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PolicyModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName, PolicyModelData 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// 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 vaultName, string policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// 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 vaultName, string policyName, PolicyModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies", 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 policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.PolicyModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.PolicyModelCollection.DeserializePolicyModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.PolicyModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.PolicyModelCollection.DeserializePolicyModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + 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 policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.PolicyModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.PolicyModelCollection.DeserializePolicyModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.PolicyModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.PolicyModelCollection.DeserializePolicyModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemOperationStatusRestOperations.cs new file mode 100644 index 000000000000..cbb8639b62d7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemOperationStatusRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class ProtectedItemOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProtectedItemOperationStatusRestOperations. + /// 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 ProtectedItemOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string operationId) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string protectedItemName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string protectedItemName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs new file mode 100644 index 000000000000..5adbcbd86f27 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class ProtectedItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProtectedItemRestOperations. + /// 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 ProtectedItemRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, 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 the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item 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 vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProtectedItemModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item 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 vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProtectedItemModelData.DeserializeProtectedItemModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProtectedItemModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, ProtectedItemModelData 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// 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 vaultName, string protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// 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 vaultName, string protectedItemName, ProtectedItemModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems", 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 protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ProtectedItemModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.ProtectedItemModelCollection.DeserializeProtectedItemModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ProtectedItemModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.ProtectedItemModelCollection.DeserializeProtectedItemModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePlannedFailoverRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/plannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task PlannedFailoverAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response PlannedFailover(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailoverModel body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + 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 protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ProtectedItemModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.ProtectedItemModelCollection.DeserializeProtectedItemModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ProtectedItemModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.ProtectedItemModelCollection.DeserializeProtectedItemModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/RecoveryPointsRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/RecoveryPointsRestOperations.cs new file mode 100644 index 000000000000..f03a375fa8d9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/RecoveryPointsRestOperations.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class RecoveryPointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RecoveryPointsRestOperations. + /// 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 RecoveryPointsRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, 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; + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item 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 vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelData.DeserializeRecoveryPointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryPointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item 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 vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RecoveryPointModelData.DeserializeRecoveryPointModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RecoveryPointModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, 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; + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.RecoveryPointModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.RecoveryPointModelCollection.DeserializeRecoveryPointModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.RecoveryPointModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.RecoveryPointModelCollection.DeserializeRecoveryPointModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + 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 recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.RecoveryPointModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.RecoveryPointModelCollection.DeserializeRecoveryPointModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.RecoveryPointModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.RecoveryPointModelCollection.DeserializeRecoveryPointModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionOperationStatusRestOperations.cs new file mode 100644 index 000000000000..e96d5503864d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionOperationStatusRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class ReplicationExtensionOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReplicationExtensionOperationStatusRestOperations. + /// 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 ReplicationExtensionOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, string operationId) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string replicationExtensionName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string replicationExtensionName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs new file mode 100644 index 000000000000..87ab57228dbd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class ReplicationExtensionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReplicationExtensionRestOperations. + /// 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 ReplicationExtensionRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, 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 the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension 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 vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationExtensionModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension 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 vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicationExtensionModelData.DeserializeReplicationExtensionModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicationExtensionModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, ReplicationExtensionModelData 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// 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 vaultName, string replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// 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 vaultName, string replicationExtensionName, ReplicationExtensionModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions", 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 replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ReplicationExtensionModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.ReplicationExtensionModelCollection.DeserializeReplicationExtensionModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ReplicationExtensionModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.ReplicationExtensionModelCollection.DeserializeReplicationExtensionModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + 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 replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.ReplicationExtensionModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.ReplicationExtensionModelCollection.DeserializeReplicationExtensionModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.ReplicationExtensionModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.ReplicationExtensionModelCollection.DeserializeReplicationExtensionModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultOperationStatusRestOperations.cs new file mode 100644 index 000000000000..cd49191158a6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultOperationStatusRestOperations.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class VaultOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VaultOperationStatusRestOperations. + /// 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 VaultOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string operationId) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultRestOperations.cs new file mode 100644 index 000000000000..9e132ae1459e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/VaultRestOperations.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class VaultRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VaultRestOperations. + /// 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 VaultRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, 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 the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault 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 vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VaultModelData.DeserializeVaultModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VaultModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault 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 vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VaultModelData.DeserializeVaultModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VaultModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, VaultModelData 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, 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); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + 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.DataReplication/replicationVaults", false); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string continuationToken) + { + 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 vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + 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 vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// 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 continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.VaultModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.VaultModelCollection.DeserializeVaultModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowOperationStatusRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowOperationStatusRestOperations.cs new file mode 100644 index 000000000000..7fcbc16218a4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowOperationStatusRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class WorkflowOperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of WorkflowOperationStatusRestOperations. + /// 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 WorkflowOperationStatusRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string jobName, string operationId) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/operations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Tracks the results of an asynchronous operation on the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job (workflow) name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string jobName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Tracks the results of an asynchronous operation on the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job (workflow) name. + /// The ID of an ongoing async operation. + /// 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 vaultName, string jobName, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OperationStatus.DeserializeOperationStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowRestOperations.cs new file mode 100644 index 000000000000..3289eedae252 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/RestOperations/WorkflowRestOperations.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + internal partial class WorkflowRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of WorkflowRestOperations. + /// 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 WorkflowRestOperations(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 ?? "2021-02-16-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job (workflow) 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 vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkflowModelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkflowModelData.DeserializeWorkflowModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkflowModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job (workflow) 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 vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkflowModelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkflowModelData.DeserializeWorkflowModelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkflowModelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string filter, string continuationToken) + { + 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.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.WorkflowModelCollection.DeserializeWorkflowModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.WorkflowModelCollection.DeserializeWorkflowModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string filter, string continuationToken) + { + 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 jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowModelCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Models.WorkflowModelCollection.DeserializeWorkflowModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Filter string. + /// Continuation token. + /// 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 vaultName, string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, filter, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowModelCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Models.WorkflowModelCollection.DeserializeWorkflowModelCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelCollection.cs new file mode 100644 index 000000000000..eecd2bf41f7e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelCollection.cs @@ -0,0 +1,344 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetVaultModels method from an instance of . + /// + public partial class VaultModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _vaultModelVaultClientDiagnostics; + private readonly VaultRestOperations _vaultModelVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected VaultModelCollection() + { + } + + /// 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 VaultModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultModelVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", VaultModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VaultModelResource.ResourceType, out string vaultModelVaultApiVersion); + _vaultModelVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultModelVaultApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Create + /// + /// + /// + /// 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 vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Create + /// + /// + /// + /// 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 vault name. + /// Vault properties. + /// 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 vaultName, VaultModelData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, 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 the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault 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 vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Get"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Get"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_List + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _vaultModelVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultModelVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), _vaultModelVaultClientDiagnostics, Pipeline, "VaultModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// Vault_List + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _vaultModelVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _vaultModelVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VaultModelResource(Client, VaultModelData.DeserializeVaultModelData(e)), _vaultModelVaultClientDiagnostics, Pipeline, "VaultModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault 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 vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Exists"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, 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.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelCollection.Exists"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelData.cs new file mode 100644 index 000000000000..6e30f6008710 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the VaultModel data model. + /// Vault model. + /// + public partial class VaultModelData : TrackedResourceData + { + /// Initializes a new instance of VaultModelData. + /// The location. + public VaultModelData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of VaultModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Vault properties. + internal VaultModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, VaultModelProperties properties) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + } + + /// Vault properties. + public VaultModelProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelResource.cs new file mode 100644 index 000000000000..51de5f6c5e09 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/VaultModelResource.cs @@ -0,0 +1,1002 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a VaultModel 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 GetVaultModelResource method. + /// Otherwise you can get one from its parent resource using the GetVaultModel method. + /// + public partial class VaultModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _vaultModelVaultClientDiagnostics; + private readonly VaultRestOperations _vaultModelVaultRestClient; + private readonly ClientDiagnostics _vaultOperationStatusClientDiagnostics; + private readonly VaultOperationStatusRestOperations _vaultOperationStatusRestClient; + private readonly VaultModelData _data; + + /// Initializes a new instance of the class for mocking. + protected VaultModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VaultModelResource(ArmClient client, VaultModelData 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 VaultModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _vaultModelVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string vaultModelVaultApiVersion); + _vaultModelVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, vaultModelVaultApiVersion); + _vaultOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _vaultOperationStatusRestClient = new VaultOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults"; + + /// 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 VaultModelData 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 EmailConfigurationModelResources in the VaultModel. + /// An object representing collection of EmailConfigurationModelResources and their operations over a EmailConfigurationModelResource. + public virtual EmailConfigurationModelCollection GetEmailConfigurationModels() + { + return GetCachedClient(Client => new EmailConfigurationModelCollection(Client, Id)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetEmailConfigurationModelAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return await GetEmailConfigurationModels().GetAsync(emailConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfiguration_Get + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetEmailConfigurationModel(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return GetEmailConfigurationModels().Get(emailConfigurationName, cancellationToken); + } + + /// Gets a collection of EventModelResources in the VaultModel. + /// An object representing collection of EventModelResources and their operations over a EventModelResource. + public virtual EventModelCollection GetEventModels() + { + return GetCachedClient(Client => new EventModelCollection(Client, Id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetEventModelAsync(string eventName, CancellationToken cancellationToken = default) + { + return await GetEventModels().GetAsync(eventName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// Event_Get + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetEventModel(string eventName, CancellationToken cancellationToken = default) + { + return GetEventModels().Get(eventName, cancellationToken); + } + + /// Gets a collection of PolicyModelResources in the VaultModel. + /// An object representing collection of PolicyModelResources and their operations over a PolicyModelResource. + public virtual PolicyModelCollection GetPolicyModels() + { + return GetCachedClient(Client => new PolicyModelCollection(Client, Id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetPolicyModelAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetPolicyModels().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// Policy_Get + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetPolicyModel(string policyName, CancellationToken cancellationToken = default) + { + return GetPolicyModels().Get(policyName, cancellationToken); + } + + /// Gets a collection of ProtectedItemModelResources in the VaultModel. + /// An object representing collection of ProtectedItemModelResources and their operations over a ProtectedItemModelResource. + public virtual ProtectedItemModelCollection GetProtectedItemModels() + { + return GetCachedClient(Client => new ProtectedItemModelCollection(Client, Id)); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetProtectedItemModelAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + return await GetProtectedItemModels().GetAsync(protectedItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItem_Get + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetProtectedItemModel(string protectedItemName, CancellationToken cancellationToken = default) + { + return GetProtectedItemModels().Get(protectedItemName, cancellationToken); + } + + /// Gets a collection of ReplicationExtensionModelResources in the VaultModel. + /// An object representing collection of ReplicationExtensionModelResources and their operations over a ReplicationExtensionModelResource. + public virtual ReplicationExtensionModelCollection GetReplicationExtensionModels() + { + return GetCachedClient(Client => new ReplicationExtensionModelCollection(Client, Id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetReplicationExtensionModelAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return await GetReplicationExtensionModels().GetAsync(replicationExtensionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtension_Get + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetReplicationExtensionModel(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return GetReplicationExtensionModels().Get(replicationExtensionName, cancellationToken); + } + + /// Gets a collection of WorkflowModelResources in the VaultModel. + /// An object representing collection of WorkflowModelResources and their operations over a WorkflowModelResource. + public virtual WorkflowModelCollection GetWorkflowModels() + { + return GetCachedClient(Client => new WorkflowModelCollection(Client, Id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetWorkflowModelAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetWorkflowModels().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetWorkflowModel(string jobName, CancellationToken cancellationToken = default) + { + return GetWorkflowModels().Get(jobName, cancellationToken); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Get"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Get"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VaultModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Delete + /// + /// + /// + /// 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 = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Delete"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(_vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Delete + /// + /// + /// + /// 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 = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Delete"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(_vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Update + /// + /// + /// + /// 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. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Update"); + scope.Start(); + try + { + var response = await _vaultModelVaultRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryservicesdatareplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Update + /// + /// + /// + /// 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. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, VaultModelPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.Update"); + scope.Start(); + try + { + var response = _vaultModelVaultRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryservicesdatareplicationArmOperation(new VaultModelOperationSource(Client), _vaultModelVaultClientDiagnostics, Pipeline, _vaultModelVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/operations/{operationId} + /// + /// + /// Operation Id + /// VaultOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetVaultOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _vaultOperationStatusClientDiagnostics.CreateScope("VaultModelResource.GetVaultOperationStatu"); + scope.Start(); + try + { + var response = await _vaultOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/operations/{operationId} + /// + /// + /// Operation Id + /// VaultOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetVaultOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _vaultOperationStatusClientDiagnostics.CreateScope("VaultModelResource.GetVaultOperationStatu"); + scope.Start(); + try + { + var response = _vaultOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _vaultModelVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// Vault_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _vaultModelVaultClientDiagnostics.CreateScope("VaultModelResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _vaultModelVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new VaultModelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new VaultModelPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelCollection.cs new file mode 100644 index 000000000000..f707e07da511 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelCollection.cs @@ -0,0 +1,263 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// 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 GetWorkflowModels method from an instance of . + /// + public partial class WorkflowModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workflowModelWorkflowClientDiagnostics; + private readonly WorkflowRestOperations _workflowModelWorkflowRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkflowModelCollection() + { + } + + /// 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 WorkflowModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workflowModelWorkflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", WorkflowModelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkflowModelResource.ResourceType, out string workflowModelWorkflowApiVersion); + _workflowModelWorkflowRestClient = new WorkflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workflowModelWorkflowApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VaultModelResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VaultModelResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) 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 jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelCollection.Get"); + scope.Start(); + try + { + var response = await _workflowModelWorkflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelCollection.Get"); + scope.Start(); + try + { + var response = _workflowModelWorkflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// Workflow_List + /// + /// + /// + /// Filter string. + /// Continuation token. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workflowModelWorkflowRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workflowModelWorkflowRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkflowModelResource(Client, WorkflowModelData.DeserializeWorkflowModelData(e)), _workflowModelWorkflowClientDiagnostics, Pipeline, "WorkflowModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// Workflow_List + /// + /// + /// + /// Filter string. + /// Continuation token. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workflowModelWorkflowRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workflowModelWorkflowRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkflowModelResource(Client, WorkflowModelData.DeserializeWorkflowModelData(e)), _workflowModelWorkflowClientDiagnostics, Pipeline, "WorkflowModelCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) 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 jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelCollection.Exists"); + scope.Start(); + try + { + var response = await _workflowModelWorkflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The job (workflow) name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelCollection.Exists"); + scope.Start(); + try + { + var response = _workflowModelWorkflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + 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/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelData.cs new file mode 100644 index 000000000000..0bd93972b904 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A class representing the WorkflowModel data model. + /// Workflow model. + /// + public partial class WorkflowModelData : ResourceData + { + /// Initializes a new instance of WorkflowModelData. + /// Workflow model properties. + /// is null. + internal WorkflowModelData(WorkflowModelProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of WorkflowModelData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Workflow model properties. + internal WorkflowModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WorkflowModelProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Workflow model properties. + public WorkflowModelProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelResource.cs new file mode 100644 index 000000000000..0599374d1d99 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Generated/WorkflowModelResource.cs @@ -0,0 +1,228 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Recoveryservicesdatareplication.Models; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication +{ + /// + /// A Class representing a WorkflowModel 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 GetWorkflowModelResource method. + /// Otherwise you can get one from its parent resource using the GetWorkflowModel method. + /// + public partial class WorkflowModelResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workflowModelWorkflowClientDiagnostics; + private readonly WorkflowRestOperations _workflowModelWorkflowRestClient; + private readonly ClientDiagnostics _workflowOperationStatusClientDiagnostics; + private readonly WorkflowOperationStatusRestOperations _workflowOperationStatusRestClient; + private readonly WorkflowModelData _data; + + /// Initializes a new instance of the class for mocking. + protected WorkflowModelResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkflowModelResource(ArmClient client, WorkflowModelData 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 WorkflowModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workflowModelWorkflowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workflowModelWorkflowApiVersion); + _workflowModelWorkflowRestClient = new WorkflowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workflowModelWorkflowApiVersion); + _workflowOperationStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Recoveryservicesdatareplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _workflowOperationStatusRestClient = new WorkflowOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/jobs"; + + /// 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 WorkflowModelData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelResource.Get"); + scope.Start(); + try + { + var response = await _workflowModelWorkflowRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// Workflow_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workflowModelWorkflowClientDiagnostics.CreateScope("WorkflowModelResource.Get"); + scope.Start(); + try + { + var response = _workflowModelWorkflowRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowModelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}/operations/{operationId} + /// + /// + /// Operation Id + /// WorkflowOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetWorkflowOperationStatuAsync(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _workflowOperationStatusClientDiagnostics.CreateScope("WorkflowModelResource.GetWorkflowOperationStatu"); + scope.Start(); + try + { + var response = await _workflowOperationStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tracks the results of an asynchronous operation on the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}/operations/{operationId} + /// + /// + /// Operation Id + /// WorkflowOperationStatus_Get + /// + /// + /// + /// The ID of an ongoing async operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetWorkflowOperationStatu(string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = _workflowOperationStatusClientDiagnostics.CreateScope("WorkflowModelResource.GetWorkflowOperationStatu"); + scope.Start(); + try + { + var response = _workflowOperationStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Properties/AssemblyInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..a7e15be57e30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("recoveryservicesdatareplication")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.Recoveryservicesdatareplication.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/autorest.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/autorest.md new file mode 100644 index 000000000000..421fcd014336 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/src/autorest.md @@ -0,0 +1,49 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: recoveryservicesdatareplication +namespace: Azure.ResourceManager.recoveryservicesdatareplication +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesdatareplication/resource-manager/readme.md +output-folder: $(this-folder)/Generated +clear-output-folder: true +skip-csproj: true +modelerfour: + flatten-payloads: false + + + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +rename-rules: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + +``` diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/Azure.ResourceManager.Recoveryservicesdatareplication.Tests.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/Azure.ResourceManager.Recoveryservicesdatareplication.Tests.csproj new file mode 100644 index 000000000000..2d348c025dca --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/Azure.ResourceManager.Recoveryservicesdatareplication.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestBase.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestBase.cs new file mode 100644 index 000000000000..ff9c9f56a738 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Tests +{ + public class recoveryservicesdatareplicationManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected recoveryservicesdatareplicationManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected recoveryservicesdatareplicationManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestEnvironment.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestEnvironment.cs new file mode 100644 index 000000000000..1d39b2e62345 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/tests/recoveryservicesdatareplicationManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Recoveryservicesdatareplication.Tests +{ + public class recoveryservicesdatareplicationManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/ci.mgmt.yml b/sdk/recoveryservicesdatareplication/ci.mgmt.yml new file mode 100644 index 000000000000..09e84bee448f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/ci.mgmt.yml @@ -0,0 +1,24 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesdatareplication/ci.mgmt.yml + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.Recoveryservicesdatareplication/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesdatareplication + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Recoveryservicesdatareplication + safeName: AzureResourceManagerRecoveryservicesdatareplication