From bac1dfa4dcd42d07a0d7e865ac2b90c65f2bf1a6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 9 May 2025 08:42:15 +0000 Subject: [PATCH] CodeGen from PR 34559 in Azure/azure-rest-api-specs Merge 32510fdc8886031f9e476cf0ebe3d7236226bfb3 into 761d8b58e465b26eddb8ad70dda3cde7b4228bdf --- ...anager.RecoveryServicesDataReplication.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ....RecoveryServicesDataReplication.net8.0.cs | 2389 +++++++++++++++++ ...yServicesDataReplication.netstandard2.0.cs | 2389 +++++++++++++++++ .../assets.json | 7 + ...veryServicesDataReplication.Samples.csproj | 13 + ...ReplicationEmailConfigurationCollection.cs | 204 ++ ...taReplicationEmailConfigurationResource.cs | 90 + .../Sample_DataReplicationEventCollection.cs | 161 ++ .../Sample_DataReplicationEventResource.cs | 49 + ...mple_DataReplicationExtensionCollection.cs | 200 ++ ...Sample_DataReplicationExtensionResource.cs | 113 + ...le_DataReplicationFabricAgentCollection.cs | 200 ++ ...mple_DataReplicationFabricAgentResource.cs | 113 + .../Sample_DataReplicationFabricCollection.cs | 197 ++ .../Sample_DataReplicationFabricResource.cs | 111 + .../Sample_DataReplicationJobCollection.cs | 161 ++ .../Sample_DataReplicationJobResource.cs | 49 + .../Sample_DataReplicationPolicyCollection.cs | 200 ++ .../Sample_DataReplicationPolicyResource.cs | 113 + ...tionPrivateEndpointConnectionCollection.cs | 209 ++ ...rivateEndpointConnectionProxyCollection.cs | 246 ++ ...nPrivateEndpointConnectionProxyResource.cs | 240 ++ ...cationPrivateEndpointConnectionResource.cs | 122 + ...mple_DataReplicationPrivateLinkResource.cs | 49 + ...eplicationPrivateLinkResourceCollection.cs | 160 ++ ..._DataReplicationProtectedItemCollection.cs | 200 ++ ...le_DataReplicationProtectedItemResource.cs | 140 + ..._DataReplicationRecoveryPointCollection.cs | 164 ++ ...le_DataReplicationRecoveryPointResource.cs | 50 + .../Sample_DataReplicationVaultCollection.cs | 204 ++ .../Sample_DataReplicationVaultResource.cs | 117 + .../Sample_ResourceGroupResourceExtensions.cs | 56 + .../Sample_SubscriptionResourceExtensions.cs | 112 + ...ger.RecoveryServicesDataReplication.csproj | 8 + ...veryServicesDataReplicationModelFactory.cs | 1413 ++++++++++ ...ReplicationEmailConfigurationCollection.cs | 497 ++++ ...ionEmailConfigurationData.Serialization.cs | 155 ++ .../DataReplicationEmailConfigurationData.cs | 75 + ...mailConfigurationResource.Serialization.cs | 26 + ...taReplicationEmailConfigurationResource.cs | 267 ++ .../DataReplicationEventCollection.cs | 401 +++ .../DataReplicationEventData.Serialization.cs | 155 ++ .../src/Generated/DataReplicationEventData.cs | 75 + ...aReplicationEventResource.Serialization.cs | 26 + .../Generated/DataReplicationEventResource.cs | 171 ++ .../DataReplicationExtensionCollection.cs | 493 ++++ ...aReplicationExtensionData.Serialization.cs | 155 ++ .../Generated/DataReplicationExtensionData.cs | 75 + ...licationExtensionResource.Serialization.cs | 26 + .../DataReplicationExtensionResource.cs | 347 +++ .../DataReplicationFabricAgentCollection.cs | 493 ++++ ...eplicationFabricAgentData.Serialization.cs | 155 ++ .../DataReplicationFabricAgentData.cs | 75 + ...cationFabricAgentResource.Serialization.cs | 26 + .../DataReplicationFabricAgentResource.cs | 347 +++ .../DataReplicationFabricCollection.cs | 496 ++++ ...DataReplicationFabricData.Serialization.cs | 178 ++ .../Generated/DataReplicationFabricData.cs | 83 + ...ReplicationFabricResource.Serialization.cs | 26 + .../DataReplicationFabricResource.cs | 776 ++++++ .../Generated/DataReplicationJobCollection.cs | 401 +++ .../DataReplicationJobData.Serialization.cs | 155 ++ .../src/Generated/DataReplicationJobData.cs | 75 + ...ataReplicationJobResource.Serialization.cs | 26 + .../Generated/DataReplicationJobResource.cs | 171 ++ .../DataReplicationPolicyCollection.cs | 493 ++++ ...DataReplicationPolicyData.Serialization.cs | 155 ++ .../Generated/DataReplicationPolicyData.cs | 75 + ...ReplicationPolicyResource.Serialization.cs | 26 + .../DataReplicationPolicyResource.cs | 347 +++ ...tionPrivateEndpointConnectionCollection.cs | 497 ++++ ...ateEndpointConnectionData.Serialization.cs | 155 ++ ...eplicationPrivateEndpointConnectionData.cs | 75 + ...rivateEndpointConnectionProxyCollection.cs | 497 ++++ ...dpointConnectionProxyData.Serialization.cs | 171 ++ ...ationPrivateEndpointConnectionProxyData.cs | 79 + ...ntConnectionProxyResource.Serialization.cs | 26 + ...nPrivateEndpointConnectionProxyResource.cs | 435 +++ ...ndpointConnectionResource.Serialization.cs | 26 + ...cationPrivateEndpointConnectionResource.cs | 351 +++ ...cationPrivateLinkResource.Serialization.cs | 26 + .../DataReplicationPrivateLinkResource.cs | 171 ++ ...eplicationPrivateLinkResourceCollection.cs | 395 +++ ...onPrivateLinkResourceData.Serialization.cs | 155 ++ .../DataReplicationPrivateLinkResourceData.cs | 75 + .../DataReplicationProtectedItemCollection.cs | 499 ++++ ...licationProtectedItemData.Serialization.cs | 155 ++ .../DataReplicationProtectedItemData.cs | 75 + ...tionProtectedItemResource.Serialization.cs | 26 + .../DataReplicationProtectedItemResource.cs | 511 ++++ .../DataReplicationRecoveryPointCollection.cs | 395 +++ ...licationRecoveryPointData.Serialization.cs | 155 ++ .../DataReplicationRecoveryPointData.cs | 75 + ...tionRecoveryPointResource.Serialization.cs | 26 + .../DataReplicationRecoveryPointResource.cs | 172 ++ .../DataReplicationVaultCollection.cs | 496 ++++ .../DataReplicationVaultData.Serialization.cs | 196 ++ .../src/Generated/DataReplicationVaultData.cs | 87 + ...aReplicationVaultResource.Serialization.cs | 26 + .../Generated/DataReplicationVaultResource.cs | 1328 +++++++++ ...ecoveryServicesDataReplicationArmClient.cs | 193 ++ ...cesDataReplicationResourceGroupResource.cs | 262 ++ ...icesDataReplicationSubscriptionResource.cs | 245 ++ ...coveryServicesDataReplicationExtensions.cs | 747 ++++++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 ++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++ .../Internal/ModelSerializationExtensions.cs | 407 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...DataReplicationExtensionOperationSource.cs | 36 + ...taReplicationFabricAgentOperationSource.cs | 36 + .../DataReplicationFabricOperationSource.cs | 36 + .../DataReplicationPolicyOperationSource.cs | 36 + ...ReplicationProtectedItemOperationSource.cs | 36 + .../DataReplicationVaultOperationSource.cs | 36 + .../PlannedFailoverOperationSource.cs | 30 + ...veryServicesDataReplicationArmOperation.cs | 94 + ...yServicesDataReplicationArmOperationOfT.cs | 100 + ...StackHciClusterProperties.Serialization.cs | 160 ++ .../Models/AzStackHciClusterProperties.cs | 97 + ...HciFabricCustomProperties.Serialization.cs | 213 ++ .../AzStackHciFabricCustomProperties.cs | 77 + ...rRecoveryServicesDataReplicationContext.cs | 19 + ...ationDiskControllerInputs.Serialization.cs | 142 + .../DataReplicationDiskControllerInputs.cs | 87 + ...ilConfigurationProperties.Serialization.cs | 177 ++ ...ReplicationEmailConfigurationProperties.cs | 85 + .../DataReplicationErrorInfo.Serialization.cs | 207 ++ .../Models/DataReplicationErrorInfo.cs | 89 + ...tionEventCustomProperties.Serialization.cs | 118 + .../DataReplicationEventCustomProperties.cs | 69 + ...eplicationEventProperties.Serialization.cs | 274 ++ .../Models/DataReplicationEventProperties.cs | 129 + ...ExtensionCustomProperties.Serialization.cs | 118 + ...ataReplicationExtensionCustomProperties.cs | 69 + ...cationExtensionProperties.Serialization.cs | 141 + .../DataReplicationExtensionProperties.cs | 91 + ...bricAgentCustomProperties.Serialization.cs | 117 + ...aReplicationFabricAgentCustomProperties.cs | 69 + ...tionFabricAgentProperties.Serialization.cs | 262 ++ .../DataReplicationFabricAgentProperties.cs | 140 + ...ionFabricCustomProperties.Serialization.cs | 119 + .../DataReplicationFabricCustomProperties.cs | 69 + ...ataReplicationFabricPatch.Serialization.cs | 181 ++ .../Models/DataReplicationFabricPatch.cs | 76 + ...plicationFabricProperties.Serialization.cs | 214 ++ .../Models/DataReplicationFabricProperties.cs | 109 + ...eplicationHealthErrorInfo.Serialization.cs | 327 +++ .../Models/DataReplicationHealthErrorInfo.cs | 120 + .../Models/DataReplicationHealthStatus.cs | 54 + .../DataReplicationIdentity.Serialization.cs | 164 ++ .../Models/DataReplicationIdentity.cs | 102 + ...ationInnerHealthErrorInfo.Serialization.cs | 259 ++ .../DataReplicationInnerHealthErrorInfo.cs | 105 + ...cationJobCustomProperties.Serialization.cs | 124 + .../DataReplicationJobCustomProperties.cs | 73 + .../Models/DataReplicationJobObjectType.cs | 69 + ...aReplicationJobProperties.Serialization.cs | 394 +++ .../Models/DataReplicationJobProperties.cs | 158 ++ .../Models/DataReplicationJobState.cs | 72 + ...onNameAvailabilityContent.Serialization.cs | 144 + .../DataReplicationNameAvailabilityContent.cs | 70 + ...ionNameAvailabilityResult.Serialization.cs | 155 ++ .../DataReplicationNameAvailabilityResult.cs | 73 + ...ionPolicyCustomProperties.Serialization.cs | 118 + .../DataReplicationPolicyCustomProperties.cs | 69 + ...plicationPolicyProperties.Serialization.cs | 141 + .../Models/DataReplicationPolicyProperties.cs | 91 + ...pointConnectionProperties.Serialization.cs | 164 ++ ...tionPrivateEndpointConnectionProperties.cs | 87 + ...ConnectionProxyProperties.Serialization.cs | 148 + ...rivateEndpointConnectionProxyProperties.cs | 69 + ...licationPrivateEndpointConnectionStatus.cs | 57 + ...ateLinkResourceProperties.Serialization.cs | 194 ++ ...eplicationPrivateLinkResourceProperties.cs | 79 + ...vateLinkServiceConnection.Serialization.cs | 165 ++ ...ReplicationPrivateLinkServiceConnection.cs | 74 + ...inkServiceConnectionState.Serialization.cs | 155 ++ ...cationPrivateLinkServiceConnectionState.cs | 73 + ...onPrivateLinkServiceProxy.Serialization.cs | 185 ++ .../DataReplicationPrivateLinkServiceProxy.cs | 92 + ...ectedItemCustomProperties.Serialization.cs | 118 + ...eplicationProtectedItemCustomProperties.cs | 69 + ...temCustomPropertiesUpdate.Serialization.cs | 118 + ...tionProtectedItemCustomPropertiesUpdate.cs | 69 + ...icationProtectedItemPatch.Serialization.cs | 154 ++ .../DataReplicationProtectedItemPatch.cs | 86 + ...onProtectedItemProperties.Serialization.cs | 538 ++++ .../DataReplicationProtectedItemProperties.cs | 207 ++ ...ectedItemPropertiesUpdate.Serialization.cs | 133 + ...eplicationProtectedItemPropertiesUpdate.cs | 73 + .../Models/DataReplicationProtectionState.cs | 201 ++ .../DataReplicationProvisioningState.cs | 66 + ...veryPointCustomProperties.Serialization.cs | 118 + ...eplicationRecoveryPointCustomProperties.cs | 69 + ...onRecoveryPointProperties.Serialization.cs | 157 ++ .../DataReplicationRecoveryPointProperties.cs | 103 + .../DataReplicationRecoveryPointType.cs | 51 + .../DataReplicationResynchronizationState.cs | 57 + .../DataReplicationTask.Serialization.cs | 221 ++ .../Generated/Models/DataReplicationTask.cs | 92 + ...ationTaskCustomProperties.Serialization.cs | 126 + .../DataReplicationTaskCustomProperties.cs | 75 + .../Models/DataReplicationTaskState.cs | 63 + .../DataReplicationTestFailoverState.cs | 72 + ...DataReplicationVaultPatch.Serialization.cs | 197 ++ .../Models/DataReplicationVaultPatch.cs | 80 + ...eplicationVaultProperties.Serialization.cs | 163 ++ .../Models/DataReplicationVaultProperties.cs | 74 + .../Models/DataReplicationVaultType.cs | 51 + .../DeploymentPreflight.Serialization.cs | 143 + .../Generated/Models/DeploymentPreflight.cs | 66 + ...mentPreflightResourceInfo.Serialization.cs | 198 ++ .../Models/DeploymentPreflightResourceInfo.cs | 111 + ...figurationModelListResult.Serialization.cs | 151 ++ .../EmailConfigurationModelListResult.cs | 80 + .../EventModelListResult.Serialization.cs | 151 ++ .../Generated/Models/EventModelListResult.cs | 80 + ...abricAgentModelListResult.Serialization.cs | 151 ++ .../Models/FabricAgentModelListResult.cs | 80 + .../FabricModelListResult.Serialization.cs | 151 ++ .../Generated/Models/FabricModelListResult.cs | 80 + ...iloverJobCustomProperties.Serialization.cs | 145 + .../Models/FailoverJobCustomProperties.cs | 37 + ...erProtectedItemProperties.Serialization.cs | 207 ++ .../Models/FailoverProtectedItemProperties.cs | 89 + ...upConnectivityInformation.Serialization.cs | 205 ++ .../Models/GroupConnectivityInformation.cs | 86 + ...ateFabricCustomProperties.Serialization.cs | 178 ++ .../HyperVMigrateFabricCustomProperties.cs | 65 + ...perVToAzStackHciDiskInput.Serialization.cs | 263 ++ .../Models/HyperVToAzStackHciDiskInput.cs | 123 + ...kHciEventCustomProperties.Serialization.cs | 172 ++ ...HyperVToAzStackHciEventCustomProperties.cs | 51 + ...yperVToAzStackHciNicInput.Serialization.cs | 205 ++ .../Models/HyperVToAzStackHciNicInput.cs | 101 + ...dFailoverCustomProperties.Serialization.cs | 118 + ...StackHciPlannedFailoverCustomProperties.cs | 42 + ...HciPolicyCustomProperties.Serialization.cs | 134 + ...yperVToAzStackHciPolicyCustomProperties.cs | 54 + ...ciProtectedDiskProperties.Serialization.cs | 315 +++ ...perVToAzStackHciProtectedDiskProperties.cs | 118 + ...ectedItemCustomProperties.Serialization.cs | 636 +++++ ...AzStackHciProtectedItemCustomProperties.cs | 234 ++ ...temCustomPropertiesUpdate.Serialization.cs | 214 ++ ...kHciProtectedItemCustomPropertiesUpdate.cs | 56 + ...HciProtectedNicProperties.Serialization.cs | 195 ++ ...yperVToAzStackHciProtectedNicProperties.cs | 85 + ...veryPointCustomProperties.Serialization.cs | 135 + ...AzStackHciRecoveryPointCustomProperties.cs | 36 + ...ExtensionCustomProperties.Serialization.cs | 318 +++ ...HciReplicationExtensionCustomProperties.cs | 109 + ...tiesAffectedObjectDetails.Serialization.cs | 144 + ...elCustomPropertiesAffectedObjectDetails.cs | 69 + ...stomPropertiesAffectedObjectDetailsType.cs | 48 + .../JobModelListResult.Serialization.cs | 151 ++ .../Generated/Models/JobModelListResult.cs | 80 + .../Models/PlannedFailover.Serialization.cs | 126 + .../src/Generated/Models/PlannedFailover.cs | 85 + ...dFailoverCustomProperties.Serialization.cs | 118 + .../Models/PlannedFailoverCustomProperties.cs | 69 + ...PlannedFailoverProperties.Serialization.cs | 126 + .../Models/PlannedFailoverProperties.cs | 87 + .../PolicyModelListResult.Serialization.cs | 151 ++ .../Generated/Models/PolicyModelListResult.cs | 80 + ...ConnectionProxyListResult.Serialization.cs | 151 ++ ...rivateEndpointConnectionProxyListResult.cs | 80 + .../Models/ProtectedItemActiveLocation.cs | 51 + ...edItemDynamicMemoryConfig.Serialization.cs | 142 + .../ProtectedItemDynamicMemoryConfig.cs | 84 + ...rotectedItemJobProperties.Serialization.cs | 211 ++ .../Models/ProtectedItemJobProperties.cs | 89 + ...tectedItemModelListResult.Serialization.cs | 151 ++ .../Models/ProtectedItemModelListResult.cs | 80 + ...overyPointModelListResult.Serialization.cs | 151 ++ .../Models/RecoveryPointModelListResult.cs | 80 + ...pointConnectionListResult.Serialization.cs | 151 ++ ...tionPrivateEndpointConnectionListResult.cs | 80 + ...ateLinkResourceListResult.Serialization.cs | 151 ++ ...eplicationPrivateLinkResourceListResult.cs | 80 + .../RemotePrivateEndpoint.Serialization.cs | 232 ++ .../Generated/Models/RemotePrivateEndpoint.cs | 95 + ...EndpointConnectionDetails.Serialization.cs | 179 ++ .../RemotePrivateEndpointConnectionDetails.cs | 81 + ...nExtensionModelListResult.Serialization.cs | 151 ++ .../ReplicationExtensionModelListResult.cs | 80 + ...torageContainerProperties.Serialization.cs | 134 + .../Models/StorageContainerProperties.cs | 82 + ...leanupJobCustomProperties.Serialization.cs | 131 + .../TestFailoverCleanupJobCustomProperties.cs | 36 + ...iloverJobCustomProperties.Serialization.cs | 145 + .../Models/TestFailoverJobCustomProperties.cs | 37 + ...tionEventCustomProperties.Serialization.cs | 110 + ...ownDataReplicationEventCustomProperties.cs | 29 + ...ExtensionCustomProperties.Serialization.cs | 110 + ...ataReplicationExtensionCustomProperties.cs | 29 + ...bricAgentCustomProperties.Serialization.cs | 110 + ...aReplicationFabricAgentCustomProperties.cs | 29 + ...ionFabricCustomProperties.Serialization.cs | 110 + ...wnDataReplicationFabricCustomProperties.cs | 29 + ...cationJobCustomProperties.Serialization.cs | 120 + ...knownDataReplicationJobCustomProperties.cs | 30 + ...ionPolicyCustomProperties.Serialization.cs | 110 + ...wnDataReplicationPolicyCustomProperties.cs | 29 + ...ectedItemCustomProperties.Serialization.cs | 110 + ...eplicationProtectedItemCustomProperties.cs | 29 + ...temCustomPropertiesUpdate.Serialization.cs | 110 + ...tionProtectedItemCustomPropertiesUpdate.cs | 29 + ...veryPointCustomProperties.Serialization.cs | 110 + ...eplicationRecoveryPointCustomProperties.cs | 29 + ...dFailoverCustomProperties.Serialization.cs | 110 + .../UnknownPlannedFailoverCustomProperties.cs | 29 + ...bricAgentCustomProperties.Serialization.cs | 126 + .../VMwareFabricAgentCustomProperties.cs | 52 + ...ateFabricCustomProperties.Serialization.cs | 126 + .../VMwareMigrateFabricCustomProperties.cs | 53 + ...wareToAzStackHciDiskInput.Serialization.cs | 263 ++ .../Models/VMwareToAzStackHciDiskInput.cs | 123 + ...kHciEventCustomProperties.Serialization.cs | 172 ++ ...VMwareToAzStackHciEventCustomProperties.cs | 51 + ...MwareToAzStackHciNicInput.Serialization.cs | 214 ++ .../Models/VMwareToAzStackHciNicInput.cs | 108 + ...dFailoverCustomProperties.Serialization.cs | 118 + ...StackHciPlannedFailoverCustomProperties.cs | 42 + ...HciPolicyCustomProperties.Serialization.cs | 134 + ...MwareToAzStackHciPolicyCustomProperties.cs | 54 + ...ciProtectedDiskProperties.Serialization.cs | 315 +++ ...wareToAzStackHciProtectedDiskProperties.cs | 118 + ...ectedItemCustomProperties.Serialization.cs | 748 ++++++ ...AzStackHciProtectedItemCustomProperties.cs | 262 ++ ...temCustomPropertiesUpdate.Serialization.cs | 214 ++ ...kHciProtectedItemCustomPropertiesUpdate.cs | 56 + ...HciProtectedNicProperties.Serialization.cs | 223 ++ ...MwareToAzStackHciProtectedNicProperties.cs | 93 + ...veryPointCustomProperties.Serialization.cs | 135 + ...AzStackHciRecoveryPointCustomProperties.cs | 36 + ...ExtensionCustomProperties.Serialization.cs | 318 +++ ...HciReplicationExtensionCustomProperties.cs | 109 + .../Models/VMwareToAzureMigrateResyncState.cs | 54 + .../VaultModelListResult.Serialization.cs | 151 ++ .../Generated/Models/VaultModelListResult.cs | 80 + .../src/Generated/Models/VmNicSelection.cs | 57 + .../src/Generated/ProviderConstants.cs | 16 + .../CheckNameAvailabilityRestOperations.cs | 132 + .../DeploymentPreflightRestOperations.cs | 142 + .../EmailConfigurationRestOperations.cs | 431 +++ .../RestOperations/EventRestOperations.cs | 357 +++ .../FabricAgentRestOperations.cs | 513 ++++ .../RestOperations/FabricRestOperations.cs | 735 +++++ .../RestOperations/JobRestOperations.cs | 357 +++ .../RestOperations/PolicyRestOperations.cs | 513 ++++ ...EndpointConnectionProxiesRestOperations.cs | 633 +++++ ...rivateEndpointConnectionsRestOperations.cs | 523 ++++ .../PrivateLinkResourcesRestOperations.cs | 321 +++ .../ProtectedItemRestOperations.cs | 761 ++++++ .../RecoveryPointRestOperations.cs | 341 +++ .../ReplicationExtensionRestOperations.cs | 513 ++++ .../RestOperations/VaultRestOperations.cs | 735 +++++ .../src/Properties/AssemblyInfo.cs | 11 + ...coveryServicesDataReplication.Tests.csproj | 8 + ...rvicesDataReplicationManagementTestBase.cs | 45 + ...ataReplicationManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + .../ci.mgmt.yml | 26 + sdk/resourcemanager/ci.mgmt.yml | 2 + sdk/storage/ci.yml | 2 + 370 files changed, 63628 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.net8.0.cs 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/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs 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/DataReplicationEmailConfigurationCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.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/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/AzStackHciFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzureResourceManagerRecoveryServicesDataReplicationContext.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.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/GroupConnectivityInformation.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.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/HyperVToAzStackHciEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.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/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.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/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.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/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.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/ProtectedItemModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.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/TestFailoverCleanupJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.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/VMwareToAzStackHciEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.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/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.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/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.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/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.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/VaultModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.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/FabricAgentRestOperations.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/JobRestOperations.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/PrivateEndpointConnectionProxiesRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.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/RecoveryPointRestOperations.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/VaultRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs 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/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml 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..fa8a7db58bc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.RecoveryServicesDataReplication.Samples", "samples\Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication", "src\Azure.ResourceManager.RecoveryServicesDataReplication.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication.Tests", "tests\Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + 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..8b33f0fedccc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ 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..63bd836ad44b --- /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..8531bbf7e62c --- /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://learn.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.net8.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs new file mode 100644 index 000000000000..1fa0682d5358 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs @@ -0,0 +1,2389 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class AzureResourceManagerRecoveryServicesDataReplicationContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerRecoveryServicesDataReplicationContext() { } + public static Azure.ResourceManager.RecoveryServicesDataReplication.AzureResourceManagerRecoveryServicesDataReplicationContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class DataReplicationEmailConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEmailConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData 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.DataReplicationEmailConfigurationData 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; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationEmailConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEmailConfigurationResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationEventCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEventCollection() { } + 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 odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationEventData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEventResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationExtensionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData 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.DataReplicationExtensionData 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; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationExtensionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationExtensionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricAgentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricAgentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData 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.DataReplicationFabricAgentData 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; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationFabricAgentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricAgentResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData 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.DataReplicationFabricData 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; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationFabricData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData 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 GetDataReplicationFabricAgent(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch 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.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationJobCollection() { } + 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 odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationJobData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationJobResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationJobResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData 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.DataReplicationPolicyData 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; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPolicyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, 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 privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, 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 DataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, 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 privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, 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 DataReplicationPrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateLinkResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, 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 privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, 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 DataReplicationPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationProtectedItemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData 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.DataReplicationProtectedItemData 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(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationProtectedItemData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationProtectedItemResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData 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 GetDataReplicationRecoveryPoint(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch 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.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationRecoveryPointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationRecoveryPointCollection() { } + 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; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationRecoveryPointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationRecoveryPointResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationVaultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData 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.DataReplicationVaultData 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; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationVaultResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData 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 GetDataReplicationEmailConfiguration(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() { throw null; } + public virtual Azure.Response GetDataReplicationEvent(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEventAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventCollection GetDataReplicationEvents() { throw null; } + public virtual Azure.Response GetDataReplicationExtension(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationExtensionAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionCollection GetDataReplicationExtensions() { throw null; } + public virtual Azure.Response GetDataReplicationJob(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationJobAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobCollection GetDataReplicationJobs() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyCollection GetDataReplicationPolicies() { throw null; } + public virtual Azure.Response GetDataReplicationPolicy(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() { throw null; } + public virtual Azure.Response GetDataReplicationProtectedItem(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationProtectedItemAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch 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.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationFabric(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationFabricAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationFabrics(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationFabricsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationVault(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationVaultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationVaults(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationVaultsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetDataReplicationFabric(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics() { throw null; } + public virtual Azure.Response GetDataReplicationVault(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationVaultAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetDataReplicationFabrics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationFabricsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDataReplicationVaults(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationVaultsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, 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.AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(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.DataReplicationEmailConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = 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.DataReplicationEventData DataReplicationEventData(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.DataReplicationEventProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties DataReplicationEventProperties(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? occurredOn = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData DataReplicationExtensionData(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.DataReplicationExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData DataReplicationFabricAgentData(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.DataReplicationFabricAgentProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeatOn = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData DataReplicationFabricData(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.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch DataReplicationFabricPatch(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.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), string serviceEndpoint = null, Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(Azure.Core.ResourceType? affectedResourceType = default(Azure.Core.ResourceType?), 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.DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(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.DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData DataReplicationJobData(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.DataReplicationJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState?), 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.DataReplicationJobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType?), 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.DataReplicationJobCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData DataReplicationPolicyData(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.DataReplicationPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(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.DataReplicationPrivateEndpointConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(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.DataReplicationPrivateEndpointConnectionProxyProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(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.DataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData DataReplicationProtectedItemData(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.DataReplicationProtectedItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(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.DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData DataReplicationRecoveryPointData(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.DataReplicationRecoveryPointProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask DataReplicationTask(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData DataReplicationVaultData(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.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch DataReplicationVaultPatch(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.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties DataReplicationVaultProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties FailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = 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.HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(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), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier 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, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier 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, Azure.Core.ResourceIdentifier targetResourceGroupId = null, Azure.Core.ResourceIdentifier 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 sourceFabricAgentName = null, string targetFabricAgentName = 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? lastRecoveryPointReceivedOn = 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.HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId = null, Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier 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.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { 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.Models.TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties TestFailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { 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), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier 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, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier storageContainerId = null, Azure.Core.ResourceIdentifier 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, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = 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.VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId = null, Azure.Core.ResourceIdentifier vmwareSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier 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 partial class AzStackHciClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHciFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties Cluster { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationDiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationErrorInfo() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationEventCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationEventCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties 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 System.DateTimeOffset? OccurredOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.Core.ResourceType? ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationExtensionCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationExtensionCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricAgentCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricAgentCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationHealthErrorInfo() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public Azure.Core.ResourceType? 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus 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.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationIdentity(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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationInnerHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationInnerHealthErrorInfo() { } + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationJobCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationJobCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType 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.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties 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.DataReplicationJobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { 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.DataReplicationJobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState 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.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationPolicyCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationPolicyCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationPrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus 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.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { 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 bool? IsResyncRequired { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties 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.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? ResynchronizationState { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState 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.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState 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.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class DataReplicationRecoveryPointCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationRecoveryPointCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationRecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationRecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType 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.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState 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.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationTask() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { 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.DataReplicationTaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState 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.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState 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.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationVaultPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType 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.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentPreflight : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflight() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResourceInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResourceInfo() { } + public string ApiVersion { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } set { } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciEventCustomProperties() { } + 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciNicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPolicyCustomProperties(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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, Azure.Core.ResourceIdentifier targetResourceGroupId, Azure.Core.ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, 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 Azure.Core.ResourceIdentifier 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? LastRecoveryPointReceivedOn { 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 SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier 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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType 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.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PlannedFailover : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailover(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties PlannedFailoverCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpointConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpointConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverCleanupJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [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 VMwareFabricAgentCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier vmwareSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciEventCustomProperties() { } + 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciNicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPolicyCustomProperties(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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier storageContainerId, Azure.Core.ResourceIdentifier targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + 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 Azure.Core.ResourceIdentifier 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? LastRecoveryPointReceivedOn { 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 SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier 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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier VmwareFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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; } + } +} 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..1fa0682d5358 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs @@ -0,0 +1,2389 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class AzureResourceManagerRecoveryServicesDataReplicationContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerRecoveryServicesDataReplicationContext() { } + public static Azure.ResourceManager.RecoveryServicesDataReplication.AzureResourceManagerRecoveryServicesDataReplicationContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class DataReplicationEmailConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEmailConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData 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.DataReplicationEmailConfigurationData 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; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationEmailConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEmailConfigurationResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationEventCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEventCollection() { } + 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 odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationEventData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEventResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationExtensionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData 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.DataReplicationExtensionData 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; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationExtensionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationExtensionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricAgentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricAgentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData 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.DataReplicationFabricAgentData 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; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationFabricAgentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricAgentResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData 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.DataReplicationFabricData 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; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationFabricData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData 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 GetDataReplicationFabricAgent(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch 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.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationJobCollection() { } + 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 odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationJobData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationJobResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationJobResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData 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.DataReplicationPolicyData 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; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPolicyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, 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 privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, 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 DataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, 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 privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, 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 DataReplicationPrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateLinkResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, 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 privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, 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 DataReplicationPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationProtectedItemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData 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.DataReplicationProtectedItemData 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(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), 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; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationProtectedItemData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationProtectedItemResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData 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 GetDataReplicationRecoveryPoint(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch 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.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationRecoveryPointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationRecoveryPointCollection() { } + 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; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationRecoveryPointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationRecoveryPointResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationVaultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData 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.DataReplicationVaultData 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; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(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 DataReplicationVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationVaultResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData 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 GetDataReplicationEmailConfiguration(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() { throw null; } + public virtual Azure.Response GetDataReplicationEvent(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEventAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventCollection GetDataReplicationEvents() { throw null; } + public virtual Azure.Response GetDataReplicationExtension(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationExtensionAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionCollection GetDataReplicationExtensions() { throw null; } + public virtual Azure.Response GetDataReplicationJob(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationJobAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobCollection GetDataReplicationJobs() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyCollection GetDataReplicationPolicies() { throw null; } + public virtual Azure.Response GetDataReplicationPolicy(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() { throw null; } + public virtual Azure.Response GetDataReplicationProtectedItem(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationProtectedItemAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() { 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; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch 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.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationFabric(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationFabricAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationFabrics(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationFabricsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationVault(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationVaultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationVaults(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationVaultsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetDataReplicationFabric(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics() { throw null; } + public virtual Azure.Response GetDataReplicationVault(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationVaultAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetDataReplicationFabrics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationFabricsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDataReplicationVaults(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationVaultsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, 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.AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(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.DataReplicationEmailConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = 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.DataReplicationEventData DataReplicationEventData(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.DataReplicationEventProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties DataReplicationEventProperties(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? occurredOn = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData DataReplicationExtensionData(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.DataReplicationExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData DataReplicationFabricAgentData(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.DataReplicationFabricAgentProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeatOn = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData DataReplicationFabricData(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.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch DataReplicationFabricPatch(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.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), string serviceEndpoint = null, Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(Azure.Core.ResourceType? affectedResourceType = default(Azure.Core.ResourceType?), 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.DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(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.DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData DataReplicationJobData(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.DataReplicationJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState?), 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.DataReplicationJobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType?), 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.DataReplicationJobCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData DataReplicationPolicyData(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.DataReplicationPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(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.DataReplicationPrivateEndpointConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(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.DataReplicationPrivateEndpointConnectionProxyProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(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.DataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData DataReplicationProtectedItemData(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.DataReplicationProtectedItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(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.DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData DataReplicationRecoveryPointData(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.DataReplicationRecoveryPointProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask DataReplicationTask(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData DataReplicationVaultData(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.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch DataReplicationVaultPatch(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.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties DataReplicationVaultProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties FailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = 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.HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(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), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier 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, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier 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, Azure.Core.ResourceIdentifier targetResourceGroupId = null, Azure.Core.ResourceIdentifier 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 sourceFabricAgentName = null, string targetFabricAgentName = 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? lastRecoveryPointReceivedOn = 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.HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId = null, Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier 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.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { 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.Models.TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties TestFailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { 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), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier 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, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier storageContainerId = null, Azure.Core.ResourceIdentifier 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, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = 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.VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId = null, Azure.Core.ResourceIdentifier vmwareSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier 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 partial class AzStackHciClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHciFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties Cluster { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationDiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationErrorInfo() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationEventCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationEventCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties 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 System.DateTimeOffset? OccurredOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.Core.ResourceType? ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationExtensionCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationExtensionCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricAgentCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricAgentCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationHealthErrorInfo() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public Azure.Core.ResourceType? 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus 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.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationIdentity(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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationInnerHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationInnerHealthErrorInfo() { } + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationJobCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationJobCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType 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.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties 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.DataReplicationJobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { 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.DataReplicationJobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState 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.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationPolicyCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationPolicyCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationPrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus 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.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { 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 bool? IsResyncRequired { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties 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.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? ResynchronizationState { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState 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.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState 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.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class DataReplicationRecoveryPointCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationRecoveryPointCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationRecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationRecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType 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.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState 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.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationTask() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { 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.DataReplicationTaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState 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.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState 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.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationVaultPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType 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.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentPreflight : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflight() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResourceInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResourceInfo() { } + public string ApiVersion { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } set { } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciEventCustomProperties() { } + 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciNicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPolicyCustomProperties(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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, Azure.Core.ResourceIdentifier targetResourceGroupId, Azure.Core.ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, 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 Azure.Core.ResourceIdentifier 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? LastRecoveryPointReceivedOn { 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 SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier 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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType 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.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PlannedFailover : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailover(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties PlannedFailoverCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpointConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpointConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverCleanupJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [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 VMwareFabricAgentCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier vmwareSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciEventCustomProperties() { } + 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; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciNicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPolicyCustomProperties(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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { 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 Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier storageContainerId, Azure.Core.ResourceIdentifier targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + 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 Azure.Core.ResourceIdentifier 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? LastRecoveryPointReceivedOn { 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 SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier 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 { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier 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 Azure.Core.ResourceIdentifier VmwareFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { 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; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json new file mode 100644 index 000000000000..f70a74c582ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/recoveryservicesdatareplication/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..cebebad85cc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs new file mode 100644 index 000000000000..8937987d88b3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEmailConfigurationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + DataReplicationEmailConfigurationData data = new DataReplicationEmailConfigurationData + { + Properties = new DataReplicationEmailConfigurationProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, emailConfigurationName, data); + DataReplicationEmailConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + DataReplicationEmailConfigurationResource result = await collection.GetAsync(emailConfigurationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_List.json + // this example is just showing the usage of "EmailConfigurationModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationEmailConfigurationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + bool result = await collection.ExistsAsync(emailConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + NullableResponse response = await collection.GetIfExistsAsync(emailConfigurationName); + DataReplicationEmailConfigurationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs new file mode 100644 index 000000000000..3c4b0cc028a9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEmailConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEmailConfigurationResource created on azure + // for more information of creating DataReplicationEmailConfigurationResource, please refer to the document of DataReplicationEmailConfigurationResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier dataReplicationEmailConfigurationResourceId = DataReplicationEmailConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + DataReplicationEmailConfigurationResource dataReplicationEmailConfiguration = client.GetDataReplicationEmailConfigurationResource(dataReplicationEmailConfigurationResourceId); + + // invoke the operation + DataReplicationEmailConfigurationResource result = await dataReplicationEmailConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEmailConfigurationResource created on azure + // for more information of creating DataReplicationEmailConfigurationResource, please refer to the document of DataReplicationEmailConfigurationResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier dataReplicationEmailConfigurationResourceId = DataReplicationEmailConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + DataReplicationEmailConfigurationResource dataReplicationEmailConfiguration = client.GetDataReplicationEmailConfigurationResource(dataReplicationEmailConfigurationResourceId); + + // invoke the operation + DataReplicationEmailConfigurationData data = new DataReplicationEmailConfigurationData + { + Properties = new DataReplicationEmailConfigurationProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await dataReplicationEmailConfiguration.UpdateAsync(WaitUntil.Completed, data); + DataReplicationEmailConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs new file mode 100644 index 000000000000..3a0cf69cd8eb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEventCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + DataReplicationEventResource result = await collection.GetAsync(eventName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheEvents() + { + // Generated from example definition: 2024-09-01/Event_List.json + // this example is just showing the usage of "EventModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation and iterate over the result + string continuationToken = "gabpzsxrifposvleqqcjnvofz"; + await foreach (DataReplicationEventResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + bool result = await collection.ExistsAsync(eventName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + NullableResponse response = await collection.GetIfExistsAsync(eventName); + DataReplicationEventResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs new file mode 100644 index 000000000000..f0646e012c1f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEventResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEventResource created on azure + // for more information of creating DataReplicationEventResource, please refer to the document of DataReplicationEventResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string eventName = "231CIG"; + ResourceIdentifier dataReplicationEventResourceId = DataReplicationEventResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, eventName); + DataReplicationEventResource dataReplicationEvent = client.GetDataReplicationEventResource(dataReplicationEventResourceId); + + // invoke the operation + DataReplicationEventResource result = await dataReplicationEvent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs new file mode 100644 index 000000000000..8333737e2075 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationExtensionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + DataReplicationExtensionData data = new DataReplicationExtensionData + { + Properties = new DataReplicationExtensionProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, replicationExtensionName, data); + DataReplicationExtensionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + DataReplicationExtensionResource result = await collection.GetAsync(replicationExtensionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheReplicationExtensions() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_List.json + // this example is just showing the usage of "ReplicationExtensionModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationExtensionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + bool result = await collection.ExistsAsync(replicationExtensionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + NullableResponse response = await collection.GetIfExistsAsync(replicationExtensionName); + DataReplicationExtensionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs new file mode 100644 index 000000000000..237c968b26c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationExtensionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + DataReplicationExtensionResource result = await dataReplicationExtension.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Delete.json + // this example is just showing the usage of "ReplicationExtensionModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + await dataReplicationExtension.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + DataReplicationExtensionData data = new DataReplicationExtensionData + { + Properties = new DataReplicationExtensionProperties(null), + }; + ArmOperation lro = await dataReplicationExtension.UpdateAsync(WaitUntil.Completed, data); + DataReplicationExtensionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs new file mode 100644 index 000000000000..53cd90f00db8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricAgentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + DataReplicationFabricAgentData data = new DataReplicationFabricAgentData + { + Properties = new DataReplicationFabricAgentProperties("envzcoijbqhtrpncbjbhk", "y", new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricAgentName, data); + DataReplicationFabricAgentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + DataReplicationFabricAgentResource result = await collection.GetAsync(fabricAgentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFabricAgents() + { + // Generated from example definition: 2024-09-01/FabricAgent_List.json + // this example is just showing the usage of "FabricAgentModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationFabricAgentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + bool result = await collection.ExistsAsync(fabricAgentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + NullableResponse response = await collection.GetIfExistsAsync(fabricAgentName); + DataReplicationFabricAgentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs new file mode 100644 index 000000000000..f02d276b5c8f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricAgentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + DataReplicationFabricAgentResource result = await dataReplicationFabricAgent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Delete.json + // this example is just showing the usage of "FabricAgentModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + await dataReplicationFabricAgent.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + DataReplicationFabricAgentData data = new DataReplicationFabricAgentData + { + Properties = new DataReplicationFabricAgentProperties("envzcoijbqhtrpncbjbhk", "y", new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await dataReplicationFabricAgent.UpdateAsync(WaitUntil.Completed, data); + DataReplicationFabricAgentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs new file mode 100644 index 000000000000..6578b367b17c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Create.json + // this example is just showing the usage of "FabricModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + DataReplicationFabricData data = new DataReplicationFabricData(new AzureLocation("tqygutlpob")) + { + Properties = new DataReplicationFabricProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricName, data); + DataReplicationFabricResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + DataReplicationFabricResource result = await collection.GetAsync(fabricName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFabrics() + { + // Generated from example definition: 2024-09-01/Fabric_List.json + // this example is just showing the usage of "FabricModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation and iterate over the result + string continuationToken = "jw"; + await foreach (DataReplicationFabricResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + bool result = await collection.ExistsAsync(fabricName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + NullableResponse response = await collection.GetIfExistsAsync(fabricName); + DataReplicationFabricResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs new file mode 100644 index 000000000000..e3b3757ec21a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + DataReplicationFabricResource result = await dataReplicationFabric.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Delete.json + // this example is just showing the usage of "FabricModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + await dataReplicationFabric.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Update.json + // this example is just showing the usage of "FabricModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + DataReplicationFabricPatch patch = new DataReplicationFabricPatch + { + Tags = { }, + Properties = new DataReplicationFabricProperties(null), + }; + ArmOperation lro = await dataReplicationFabric.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationFabricResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs new file mode 100644 index 000000000000..295a2fc2e6ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationJobCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + DataReplicationJobResource result = await collection.GetAsync(jobName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheJobs() + { + // Generated from example definition: 2024-09-01/Job_List.json + // this example is just showing the usage of "JobModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation and iterate over the result + string continuationToken = "rdavrzbethhslmkqgajontnxsue"; + await foreach (DataReplicationJobResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + bool result = await collection.ExistsAsync(jobName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + NullableResponse response = await collection.GetIfExistsAsync(jobName); + DataReplicationJobResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs new file mode 100644 index 000000000000..4d35112545de --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationJobResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationJobResource created on azure + // for more information of creating DataReplicationJobResource, please refer to the document of DataReplicationJobResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string jobName = "ZGH4y"; + ResourceIdentifier dataReplicationJobResourceId = DataReplicationJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, jobName); + DataReplicationJobResource dataReplicationJob = client.GetDataReplicationJobResource(dataReplicationJobResourceId); + + // invoke the operation + DataReplicationJobResource result = await dataReplicationJob.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs new file mode 100644 index 000000000000..aad7c15fac50 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPolicyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "fafqwc"; + DataReplicationPolicyData data = new DataReplicationPolicyData + { + Properties = new DataReplicationPolicyProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, data); + DataReplicationPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + DataReplicationPolicyResource result = await collection.GetAsync(policyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePolicies() + { + // Generated from example definition: 2024-09-01/Policy_List.json + // this example is just showing the usage of "PolicyModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + bool result = await collection.ExistsAsync(policyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + NullableResponse response = await collection.GetIfExistsAsync(policyName); + DataReplicationPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs new file mode 100644 index 000000000000..e76b004b6589 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPolicyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wdqsacasc"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + DataReplicationPolicyResource result = await dataReplicationPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Delete.json + // this example is just showing the usage of "PolicyModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wqfscsdv"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + await dataReplicationPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "fafqwc"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + DataReplicationPolicyData data = new DataReplicationPolicyData + { + Properties = new DataReplicationPolicyProperties(null), + }; + ArmOperation lro = await dataReplicationPolicy.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..a01eefd0873b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jitf"; + DataReplicationPrivateEndpointConnectionData data = new DataReplicationPrivateEndpointConnectionData + { + Properties = new DataReplicationPrivateEndpointConnectionProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState + { + Status = DataReplicationPrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + DataReplicationPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + DataReplicationPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePrivateEndpointConnections() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_List.json + // this example is just showing the usage of "PrivateEndpointConnection_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..3478399b0a8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionProxyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionProxyName, data); + DataReplicationPrivateEndpointConnectionProxyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + DataReplicationPrivateEndpointConnectionProxyResource result = await collection.GetAsync(privateEndpointConnectionProxyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_List.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateEndpointConnectionProxyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + bool result = await collection.ExistsAsync(privateEndpointConnectionProxyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..c8786067cd31 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionProxyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyResource result = await dataReplicationPrivateEndpointConnectionProxy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePrivateEndpointProxyConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Delete.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + await dataReplicationPrivateEndpointConnectionProxy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + ArmOperation lro = await dataReplicationPrivateEndpointConnectionProxy.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPrivateEndpointConnectionProxyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Validate_ValidatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Validate.json + // this example is just showing the usage of "PrivateEndpointConnectionProxies_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + DataReplicationPrivateEndpointConnectionProxyResource result = await dataReplicationPrivateEndpointConnectionProxy.ValidateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..a7e99a69865d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "vbkm"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionResource result = await dataReplicationPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Delete.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "sdwqtfhigjirrzhpbmqtzgs"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + await dataReplicationPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "jitf"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionData data = new DataReplicationPrivateEndpointConnectionData + { + Properties = new DataReplicationPrivateEndpointConnectionProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState + { + Status = DataReplicationPrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await dataReplicationPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs new file mode 100644 index 000000000000..fb3c2f216692 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateLinkResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateLinkResource created on azure + // for more information of creating DataReplicationPrivateLinkResource, please refer to the document of DataReplicationPrivateLinkResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateLinkResourceName = "d"; + ResourceIdentifier dataReplicationPrivateLinkResourceId = DataReplicationPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + DataReplicationPrivateLinkResource dataReplicationPrivateLinkResource = client.GetDataReplicationPrivateLinkResource(dataReplicationPrivateLinkResourceId); + + // invoke the operation + DataReplicationPrivateLinkResource result = await dataReplicationPrivateLinkResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..ed489b30f9b9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateLinkResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + DataReplicationPrivateLinkResource result = await collection.GetAsync(privateLinkResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateLinkResourceListGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_List.json + // this example is just showing the usage of "PrivateLinkResource_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateLinkResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + DataReplicationPrivateLinkResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs new file mode 100644 index 000000000000..e57e7bc5ee7e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationProtectedItemCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Create.json + // this example is just showing the usage of "ProtectedItemModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + DataReplicationProtectedItemData data = new DataReplicationProtectedItemData + { + Properties = new DataReplicationProtectedItemProperties("tjoeiynplt", "jwxdo", null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, protectedItemName, data); + DataReplicationProtectedItemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + DataReplicationProtectedItemResource result = await collection.GetAsync(protectedItemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheProtectedItems() + { + // Generated from example definition: 2024-09-01/ProtectedItem_List.json + // this example is just showing the usage of "ProtectedItemModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationProtectedItemResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + bool result = await collection.ExistsAsync(protectedItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(protectedItemName); + DataReplicationProtectedItemResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs new file mode 100644 index 000000000000..0ea8a0e7859c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationProtectedItemResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + DataReplicationProtectedItemResource result = await dataReplicationProtectedItem.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Delete.json + // this example is just showing the usage of "ProtectedItemModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + bool? forceDelete = true; + await dataReplicationProtectedItem.DeleteAsync(WaitUntil.Completed, forceDelete: forceDelete); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Update.json + // this example is just showing the usage of "ProtectedItemModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + DataReplicationProtectedItemPatch patch = new DataReplicationProtectedItemPatch(); + ArmOperation lro = await dataReplicationProtectedItem.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationProtectedItemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PlannedFailover_PerformsPlannedFailover() + { + // Generated from example definition: 2024-09-01/ProtectedItem_PlannedFailover.json + // this example is just showing the usage of "ProtectedItem_PlannedFailover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + PlannedFailover body = new PlannedFailover(new PlannedFailoverProperties(null)); + ArmOperation lro = await dataReplicationProtectedItem.PlannedFailoverAsync(WaitUntil.Completed, body); + PlannedFailover result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs new file mode 100644 index 000000000000..a39049a8d26a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationRecoveryPointCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + DataReplicationRecoveryPointResource result = await collection.GetAsync(recoveryPointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheRecoveryPoints() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_List.json + // this example is just showing the usage of "RecoveryPointModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationRecoveryPointResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + bool result = await collection.ExistsAsync(recoveryPointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + NullableResponse response = await collection.GetIfExistsAsync(recoveryPointName); + DataReplicationRecoveryPointResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs new file mode 100644 index 000000000000..f598d5f26dc4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationRecoveryPointResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationRecoveryPointResource created on azure + // for more information of creating DataReplicationRecoveryPointResource, please refer to the document of DataReplicationRecoveryPointResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + string recoveryPointName = "1X"; + ResourceIdentifier dataReplicationRecoveryPointResourceId = DataReplicationRecoveryPointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + DataReplicationRecoveryPointResource dataReplicationRecoveryPoint = client.GetDataReplicationRecoveryPointResource(dataReplicationRecoveryPointResourceId); + + // invoke the operation + DataReplicationRecoveryPointResource result = await dataReplicationRecoveryPoint.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs new file mode 100644 index 000000000000..d23d7f613704 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationVaultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Create.json + // this example is just showing the usage of "VaultModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + DataReplicationVaultData data = new DataReplicationVaultData(new AzureLocation("eck")) + { + Properties = new DataReplicationVaultProperties + { + VaultType = DataReplicationVaultType.DisasterRecovery, + }, + Tags = +{ +["key5359"] = "ljfilxolxzuxrauopwtyxghrp" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data); + DataReplicationVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + DataReplicationVaultResource result = await collection.GetAsync(vaultName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheVaults() + { + // Generated from example definition: 2024-09-01/Vault_List.json + // this example is just showing the usage of "VaultModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation and iterate over the result + string continuationToken = "mwculdaqndp"; + await foreach (DataReplicationVaultResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + bool result = await collection.ExistsAsync(vaultName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + NullableResponse response = await collection.GetIfExistsAsync(vaultName); + DataReplicationVaultResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs new file mode 100644 index 000000000000..03fe545f4ea8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationVaultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + DataReplicationVaultResource result = await dataReplicationVault.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Delete.json + // this example is just showing the usage of "VaultModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + await dataReplicationVault.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Update.json + // this example is just showing the usage of "VaultModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + DataReplicationVaultPatch patch = new DataReplicationVaultPatch + { + Tags = +{ +["key8872"] = "pvtc" +}, + Properties = new DataReplicationVaultProperties + { + VaultType = DataReplicationVaultType.DisasterRecovery, + }, + }; + ArmOperation lro = await dataReplicationVault.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 000000000000..62c2faffdd2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostDeploymentPreflight_PerformsResourceDeploymentValidation() + { + // Generated from example definition: 2024-09-01/DeploymentPreflight_Post.json + // this example is just showing the usage of "DeploymentPreflight_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string deploymentId = "lnfcwsmlowbwkndkztzvaj"; + DeploymentPreflight body = new DeploymentPreflight + { + Resources = {new DeploymentPreflightResourceInfo +{ +Name = "xtgugoflfc", +Type = new ResourceType("nsnaptduolqcxsikrewvgjbxqpt"), +Location = new AzureLocation("cbsgtxkjdzwbyp"), +ApiVersion = "otihymhvzblycdoxo", +}}, + }; + DeploymentPreflight result = await resourceGroupResource.PostDeploymentPreflightAsync(deploymentId, body: body); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..1e5f0264ceeb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDataReplicationVaults_ListsTheVaultsBySubscription() + { + // Generated from example definition: 2024-09-01/Vault_ListBySubscription.json + // this example is just showing the usage of "VaultModel_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DataReplicationVaultResource item in subscriptionResource.GetDataReplicationVaultsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDataReplicationFabrics_ListsTheFabricsBySubscription() + { + // Generated from example definition: 2024-09-01/Fabric_ListBySubscription.json + // this example is just showing the usage of "FabricModel_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DataReplicationFabricResource item in subscriptionResource.GetDataReplicationFabricsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostCheckNameAvailability_PerformsTheResourceNameAvailabilityCheck() + { + // Generated from example definition: 2024-09-01/CheckNameAvailability_Post.json + // this example is just showing the usage of "CheckNameAvailability_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("trfqtbtmusswpibw"); + DataReplicationNameAvailabilityContent content = new DataReplicationNameAvailabilityContent + { + Name = "updkdcixs", + Type = new ResourceType("gngmcancdauwhdixjjvqnfkvqc"), + }; + DataReplicationNameAvailabilityResult result = await subscriptionResource.PostCheckNameAvailabilityAsync(location, content: content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} 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..ded5f53eb128 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider RecoveryServicesDataReplication. + 1.0.0-beta.1 + azure;management;arm;resource manager;recoveryservicesdatareplication + Azure.ResourceManager.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..e07788d3eb10 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs @@ -0,0 +1,1413 @@ +// 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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Model factory for models. + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationEmailConfigurationProperties properties = null) + { + return new DataReplicationEmailConfigurationData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets the provisioning state of the email configuration. + /// A new instance for mocking. + public static DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = default, IEnumerable customEmailAddresses = null, string locale = null, DataReplicationProvisioningState? provisioningState = null) + { + customEmailAddresses ??= new List(); + + return new DataReplicationEmailConfigurationProperties(sendToOwners, customEmailAddresses?.ToList(), locale, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static DataReplicationVaultData DataReplicationVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DataReplicationVaultProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DataReplicationVaultData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationVaultProperties DataReplicationVaultProperties(DataReplicationProvisioningState? provisioningState = null, ResourceIdentifier serviceResourceId = null, DataReplicationVaultType? vaultType = null) + { + return new DataReplicationVaultProperties(provisioningState, serviceResourceId, vaultType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// A new instance for mocking. + public static DataReplicationVaultPatch DataReplicationVaultPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, DataReplicationVaultProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DataReplicationVaultPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationEventData DataReplicationEventData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationEventProperties properties = null) + { + return new DataReplicationEventData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 and . + /// + /// Gets or sets the provisioning state of the event. + /// A new instance for mocking. + public static DataReplicationEventProperties DataReplicationEventProperties(ResourceType? resourceType = null, string resourceName = null, string eventType = null, string eventName = null, DateTimeOffset? occurredOn = null, string severity = null, string description = null, string correlationId = null, IEnumerable healthErrors = null, DataReplicationEventCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + healthErrors ??= new List(); + + return new DataReplicationEventProperties( + resourceType, + resourceName, + eventType, + eventName, + occurredOn, + severity, + description, + correlationId, + healthErrors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(ResourceType? 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 DataReplicationHealthErrorInfo( + affectedResourceType, + affectedResourceCorrelationIds?.ToList(), + childErrors?.ToList(), + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(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 DataReplicationInnerHealthErrorInfo( + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new HyperVToAzStackHciEventCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// Initializes a new instance of . + /// 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 VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new VMwareToAzStackHciEventCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationFabricData DataReplicationFabricData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DataReplicationFabricProperties properties = null) + { + tags ??= new Dictionary(); + + return new DataReplicationFabricData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationFabricProperties DataReplicationFabricProperties(DataReplicationProvisioningState? provisioningState = null, string serviceEndpoint = null, ResourceIdentifier serviceResourceId = null, DataReplicationHealthStatus? health = null, IEnumerable healthErrors = null, DataReplicationFabricCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new DataReplicationFabricProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(ResourceIdentifier azStackHciSiteId = null, IEnumerable applianceName = null, AzStackHciClusterProperties cluster = null, ResourceIdentifier fabricResourceId = null, ResourceIdentifier fabricContainerId = null, ResourceIdentifier migrationSolutionId = null, Uri migrationHubUri = null) + { + applianceName ??= new List(); + + return new AzStackHciFabricCustomProperties( + "AzStackHCI", + serializedAdditionalRawData: null, + azStackHciSiteId, + applianceName?.ToList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// 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 HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(ResourceIdentifier hyperVSiteId = null, ResourceIdentifier fabricResourceId = null, ResourceIdentifier fabricContainerId = null, ResourceIdentifier migrationSolutionId = null, Uri migrationHubUri = null) + { + return new HyperVMigrateFabricCustomProperties( + "HyperVMigrate", + serializedAdditionalRawData: null, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// A new instance for mocking. + public static DataReplicationFabricPatch DataReplicationFabricPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, DataReplicationFabricProperties properties = null) + { + tags ??= new Dictionary(); + + return new DataReplicationFabricPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationFabricAgentData DataReplicationFabricAgentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationFabricAgentProperties properties = null) + { + return new DataReplicationFabricAgentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent 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 DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, DataReplicationIdentity authenticationIdentity = null, DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = null, DateTimeOffset? lastHeartbeatOn = null, string versionNumber = null, DataReplicationProvisioningState? provisioningState = null, IEnumerable healthErrors = null, DataReplicationFabricAgentCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new DataReplicationFabricAgentProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeatOn, + versionNumber, + provisioningState, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationJobData DataReplicationJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationJobProperties properties = null) + { + return new DataReplicationJobData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job 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 job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job 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 . + /// + /// Gets or sets the provisioning state of the job. + /// A new instance for mocking. + public static DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, DataReplicationJobState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, DataReplicationJobObjectType? objectType = null, string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, IEnumerable allowedActions = null, string activityId = null, IEnumerable tasks = null, IEnumerable errors = null, DataReplicationJobCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + allowedActions ??= new List(); + tasks ??= new List(); + errors ??= new List(); + + return new DataReplicationJobProperties( + displayName, + state, + startOn, + endOn, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions?.ToList(), + activityId, + tasks?.ToList(), + errors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 job models. + /// A new instance for mocking. + public static DataReplicationTask DataReplicationTask(string taskName = null, DataReplicationTaskState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string customInstanceType = null, IEnumerable childrenJobs = null) + { + childrenJobs ??= new List(); + + return new DataReplicationTask( + taskName, + state, + startOn, + endOn, + customInstanceType != null ? new DataReplicationTaskCustomProperties(customInstanceType, serializedAdditionalRawData: null) : null, + childrenJobs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = null, string severity = null, DateTimeOffset? createdOn = null, string message = null, string causes = null, string recommendation = null) + { + return new DataReplicationErrorInfo( + code, + type, + severity, + createdOn, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// A new instance for mocking. + public static DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) + { + return new UnknownDataReplicationJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, JobModelCustomPropertiesAffectedObjectDetailsType? type = null) + { + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 FailoverJobCustomProperties FailoverJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new FailoverJobCustomProperties("FailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// 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, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) + { + return new TestFailoverCleanupJobCustomProperties("TestFailoverCleanupJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, comments); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test VM details. + /// A new instance for mocking. + public static TestFailoverJobCustomProperties TestFailoverJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new TestFailoverJobCustomProperties("TestFailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPolicyData DataReplicationPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPolicyProperties properties = null) + { + return new DataReplicationPolicyData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationPolicyProperties DataReplicationPolicyProperties(DataReplicationProvisioningState? provisioningState = null, DataReplicationPolicyCustomProperties customProperties = null) + { + return new DataReplicationPolicyProperties(provisioningState, customProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateEndpointConnectionProperties properties = null) + { + return new DataReplicationPrivateEndpointConnectionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(DataReplicationProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) + { + return new DataReplicationPrivateEndpointConnectionProperties(provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, privateLinkServiceConnectionState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateEndpointConnectionProxyProperties properties = null, ETag? etag = null) + { + return new DataReplicationPrivateEndpointConnectionProxyData( + id, + name, + resourceType, + systemData, + properties, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(DataReplicationProvisioningState? provisioningState = null, RemotePrivateEndpoint remotePrivateEndpoint = null) + { + return new DataReplicationPrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateLinkResourceProperties properties = null) + { + return new DataReplicationPrivateLinkResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// A new instance for mocking. + public static DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, DataReplicationProvisioningState? provisioningState = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new DataReplicationPrivateLinkResourceProperties(groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationProtectedItemData DataReplicationProtectedItemData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationProtectedItemProperties properties = null) + { + return new DataReplicationProtectedItemData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 fabric agent. + /// 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 fabric agent Id. + /// Gets or sets the target fabric agent 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 current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// 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 DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, DataReplicationProvisioningState? provisioningState = null, DataReplicationProtectionState? protectionState = null, string protectionStateDescription = null, DataReplicationTestFailoverState? testFailoverState = null, string testFailoverStateDescription = null, DataReplicationResynchronizationState? resynchronizationState = null, string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = null, DateTimeOffset? lastSuccessfulPlannedFailoverOn = null, DateTimeOffset? lastSuccessfulUnplannedFailoverOn = null, DateTimeOffset? lastSuccessfulTestFailoverOn = null, ProtectedItemJobProperties currentJob = null, IEnumerable allowedJobs = null, ProtectedItemJobProperties lastFailedEnableProtectionJob = null, ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, ProtectedItemJobProperties lastTestFailoverJob = null, DataReplicationHealthStatus? replicationHealth = null, IEnumerable healthErrors = null, DataReplicationProtectedItemCustomProperties customProperties = null) + { + allowedJobs ??= new List(); + healthErrors ??= new List(); + + return new DataReplicationProtectedItemProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + isResyncRequired, + lastSuccessfulPlannedFailoverOn, + lastSuccessfulUnplannedFailoverOn, + lastSuccessfulTestFailoverOn, + currentJob, + allowedJobs?.ToList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// 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, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 fabric agent name. + /// Gets or sets the target fabric agent 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 HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(ProtectedItemActiveLocation? activeLocation = null, ResourceIdentifier targetHciClusterId = null, ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, ResourceIdentifier fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string targetVmName = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier 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 sourceFabricAgentName = null, string targetFabricAgentName = 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? lastRecoveryPointReceivedOn = 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 HyperVToAzStackHciProtectedItemCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude?.ToList(), + nicsToInclude?.ToList(), + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceivedOn, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks?.ToList(), + protectedNics?.ToList(), + targetVmBiosId, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// A new instance for mocking. + public static HyperVToAzStackHciNicInput HyperVToAzStackHciNicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new HyperVToAzStackHciNicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(ResourceIdentifier 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, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new HyperVToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 fabric agent name. + /// Gets or sets the target fabric agent 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 VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(ProtectedItemActiveLocation? activeLocation = null, ResourceIdentifier targetHciClusterId = null, ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, ResourceIdentifier storageContainerId = null, ResourceIdentifier 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, ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceivedOn = 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 VMwareToAzStackHciProtectedItemCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + 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, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceivedOn, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// 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, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new VMwareToAzStackHciNicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(ResourceIdentifier 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, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new VMwareToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// A new instance for mocking. + public static DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) + { + return new DataReplicationProtectedItemPatch( + id, + name, + resourceType, + systemData, + customProperties != null ? new DataReplicationProtectedItemPropertiesUpdate(customProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationRecoveryPointData DataReplicationRecoveryPointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationRecoveryPointProperties properties = null) + { + return new DataReplicationRecoveryPointData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 and . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// A new instance for mocking. + public static DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn = default, DataReplicationRecoveryPointType recoveryPointType = default, DataReplicationRecoveryPointCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + return new DataReplicationRecoveryPointProperties(recoveryPointOn, recoveryPointType, customProperties, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new HyperVToAzStackHciRecoveryPointCustomProperties("HyperVToAzStackHCI", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new VMwareToAzStackHciRecoveryPointCustomProperties("VMwareToAzStackHCIRecoveryPointModelCustomProperties", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationExtensionData DataReplicationExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationExtensionProperties properties = null) + { + return new DataReplicationExtensionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 DataReplicationExtensionProperties DataReplicationExtensionProperties(DataReplicationProvisioningState? provisioningState = null, DataReplicationExtensionCustomProperties customProperties = null) + { + return new DataReplicationExtensionProperties(provisioningState, customProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// 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 HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier hyperVFabricArmId = null, ResourceIdentifier hyperVSiteId = null, ResourceIdentifier azStackHciFabricArmId = null, ResourceIdentifier 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 HyperVToAzStackHciReplicationExtensionCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// Initializes a new instance of . + /// 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 VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier vmwareFabricArmId = null, ResourceIdentifier vmwareSiteId = null, ResourceIdentifier azStackHciFabricArmId = null, ResourceIdentifier 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 VMwareToAzStackHciReplicationExtensionCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// Initializes a new instance of . + /// 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 DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = null, string reason = null, string message = null) + { + return new DataReplicationNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs new file mode 100644 index 000000000000..0ddf694241ee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationEmailConfigurations method from an instance of . + /// + public partial class DataReplicationEmailConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _dataReplicationEmailConfigurationEmailConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEmailConfigurationCollection() + { + } + + /// 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 DataReplicationEmailConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationEmailConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationEmailConfigurationResource.ResourceType, out string dataReplicationEmailConfigurationEmailConfigurationApiVersion); + _dataReplicationEmailConfigurationEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEmailConfigurationEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.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 + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + 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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(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 + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEmailConfigurationResource(Client, DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(e)), _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics, Pipeline, "DataReplicationEmailConfigurationCollection.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 + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEmailConfigurationResource(Client, DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(e)), _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics, Pipeline, "DataReplicationEmailConfigurationCollection.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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs new file mode 100644 index 000000000000..cefc023cbc1e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationEmailConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEmailConfigurationData(document.RootElement, options); + } + + internal static DataReplicationEmailConfigurationData DeserializeDataReplicationEmailConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationEmailConfigurationProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationEmailConfigurationProperties.DeserializeDataReplicationEmailConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEmailConfigurationData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEmailConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEmailConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs new file mode 100644 index 000000000000..c1304e975d21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationEmailConfiguration data model. + /// Email configuration model. + /// + public partial class DataReplicationEmailConfigurationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationEmailConfigurationData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEmailConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationEmailConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationEmailConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..94507090c95f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationEmailConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationEmailConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs new file mode 100644 index 000000000000..f41692182ae8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationEmailConfiguration 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 GetDataReplicationEmailConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationEmailConfiguration method. + /// + public partial class DataReplicationEmailConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The emailConfigurationName. + 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 _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _dataReplicationEmailConfigurationEmailConfigurationRestClient; + private readonly DataReplicationEmailConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/alertSettings"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEmailConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationEmailConfigurationResource(ArmClient client, DataReplicationEmailConfigurationData 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 DataReplicationEmailConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationEmailConfigurationEmailConfigurationApiVersion); + _dataReplicationEmailConfigurationEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEmailConfigurationEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationEmailConfigurationData 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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.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 DataReplicationEmailConfigurationResource(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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(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 + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + 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/DataReplicationEventCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs new file mode 100644 index 000000000000..8251eebbed31 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationEvents method from an instance of . + /// + public partial class DataReplicationEventCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationEventEventClientDiagnostics; + private readonly EventRestOperations _dataReplicationEventEventRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEventCollection() + { + } + + /// 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 DataReplicationEventCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEventEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationEventResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationEventResource.ResourceType, out string dataReplicationEventEventApiVersion); + _dataReplicationEventEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEventEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(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 + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEventEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEventEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEventResource(Client, DataReplicationEventData.DeserializeDataReplicationEventData(e)), _dataReplicationEventEventClientDiagnostics, Pipeline, "DataReplicationEventCollection.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 + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEventEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEventEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEventResource(Client, DataReplicationEventData.DeserializeDataReplicationEventData(e)), _dataReplicationEventEventClientDiagnostics, Pipeline, "DataReplicationEventCollection.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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs new file mode 100644 index 000000000000..2cc308dc0f80 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEventData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventData(document.RootElement, options); + } + + internal static DataReplicationEventData DeserializeDataReplicationEventData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationEventProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationEventProperties.DeserializeDataReplicationEventProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEventData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs new file mode 100644 index 000000000000..0c6f9016a4d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationEvent data model. + /// Event model. + /// + public partial class DataReplicationEventData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationEventData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationEventProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationEventProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs new file mode 100644 index 000000000000..b5026b63dd88 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEventResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs new file mode 100644 index 000000000000..b6e992c7f5da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationEvent 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 GetDataReplicationEventResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationEvent method. + /// + public partial class DataReplicationEventResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The eventName. + 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 _dataReplicationEventEventClientDiagnostics; + private readonly EventRestOperations _dataReplicationEventEventRestClient; + private readonly DataReplicationEventData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/events"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEventResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationEventResource(ArmClient client, DataReplicationEventData 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 DataReplicationEventResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEventEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationEventEventApiVersion); + _dataReplicationEventEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEventEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationEventData 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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.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 DataReplicationEventResource(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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs new file mode 100644 index 000000000000..de79586a9ba3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationExtensions method from an instance of . + /// + public partial class DataReplicationExtensionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationExtensionReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _dataReplicationExtensionReplicationExtensionRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationExtensionCollection() + { + } + + /// 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 DataReplicationExtensionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationExtensionReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationExtensionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationExtensionResource.ResourceType, out string dataReplicationExtensionReplicationExtensionApiVersion); + _dataReplicationExtensionReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationExtensionReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.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 + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(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 + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationExtensionResource(Client, DataReplicationExtensionData.DeserializeDataReplicationExtensionData(e)), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, "DataReplicationExtensionCollection.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 + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationExtensionResource(Client, DataReplicationExtensionData.DeserializeDataReplicationExtensionData(e)), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, "DataReplicationExtensionCollection.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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs new file mode 100644 index 000000000000..d2b57daee023 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationExtensionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationExtensionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionData(document.RootElement, options); + } + + internal static DataReplicationExtensionData DeserializeDataReplicationExtensionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationExtensionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationExtensionProperties.DeserializeDataReplicationExtensionProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationExtensionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs new file mode 100644 index 000000000000..9545a0ca87b9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationExtension data model. + /// Replication extension model. + /// + public partial class DataReplicationExtensionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationExtensionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationExtensionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationExtensionProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs new file mode 100644 index 000000000000..8f2cee87af62 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationExtensionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationExtensionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationExtensionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs new file mode 100644 index 000000000000..3f20dcf023be --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationExtension 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 GetDataReplicationExtensionResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationExtension method. + /// + public partial class DataReplicationExtensionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The replicationExtensionName. + 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 _dataReplicationExtensionReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _dataReplicationExtensionReplicationExtensionRestClient; + private readonly DataReplicationExtensionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationExtensions"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationExtensionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationExtensionResource(ArmClient client, DataReplicationExtensionData 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 DataReplicationExtensionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationExtensionReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationExtensionReplicationExtensionApiVersion); + _dataReplicationExtensionReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationExtensionReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationExtensionData 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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.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 DataReplicationExtensionResource(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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(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 + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.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 + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.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 + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs new file mode 100644 index 000000000000..03d6314fd129 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationFabricAgents method from an instance of . + /// + public partial class DataReplicationFabricAgentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationFabricAgentFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _dataReplicationFabricAgentFabricAgentRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricAgentCollection() + { + } + + /// 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 DataReplicationFabricAgentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricAgentFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricAgentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationFabricAgentResource.ResourceType, out string dataReplicationFabricAgentFabricAgentApiVersion); + _dataReplicationFabricAgentFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricAgentFabricAgentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationFabricResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationFabricResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric agent name. + /// Fabric agent 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, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric agent name. + /// Fabric agent 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, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent 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 = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent 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 = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(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 + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricAgentResource(Client, DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(e)), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, "DataReplicationFabricAgentCollection.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 + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricAgentResource(Client, DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(e)), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, "DataReplicationFabricAgentCollection.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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent 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 = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent 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 = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs new file mode 100644 index 000000000000..8b26dd150199 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricAgentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationFabricAgentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentData(document.RootElement, options); + } + + internal static DataReplicationFabricAgentData DeserializeDataReplicationFabricAgentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationFabricAgentProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricAgentProperties.DeserializeDataReplicationFabricAgentProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricAgentData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs new file mode 100644 index 000000000000..f8d327a26466 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationFabricAgent data model. + /// Fabric agent model. + /// + public partial class DataReplicationFabricAgentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationFabricAgentData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationFabricAgentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationFabricAgentProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs new file mode 100644 index 000000000000..e4030e8929ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricAgentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationFabricAgentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationFabricAgentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs new file mode 100644 index 000000000000..4f3e4be113ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationFabricAgent 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 GetDataReplicationFabricAgentResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationFabricAgent method. + /// + public partial class DataReplicationFabricAgentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + /// The fabricAgentName. + 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 _dataReplicationFabricAgentFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _dataReplicationFabricAgentFabricAgentRestClient; + private readonly DataReplicationFabricAgentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics/fabricAgents"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricAgentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationFabricAgentResource(ArmClient client, DataReplicationFabricAgentData 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 DataReplicationFabricAgentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricAgentFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationFabricAgentFabricAgentApiVersion); + _dataReplicationFabricAgentFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricAgentFabricAgentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationFabricAgentData 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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.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 DataReplicationFabricAgentResource(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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.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 fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.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 + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs new file mode 100644 index 000000000000..1a7c875c1bf4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.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 GetDataReplicationFabrics method from an instance of . + /// + public partial class DataReplicationFabricCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; + private readonly FabricRestOperations _dataReplicationFabricFabricRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricCollection() + { + } + + /// 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 DataReplicationFabricCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationFabricResource.ResourceType, out string dataReplicationFabricFabricApiVersion); + _dataReplicationFabricFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricFabricApiVersion); +#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 + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(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 + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dataReplicationFabricFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), _dataReplicationFabricFabricClientDiagnostics, Pipeline, "DataReplicationFabricCollection.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 + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dataReplicationFabricFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), _dataReplicationFabricFabricClientDiagnostics, Pipeline, "DataReplicationFabricCollection.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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs new file mode 100644 index 000000000000..a9a7ee45fa4b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationFabricData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricData(document.RootElement, options); + } + + internal static DataReplicationFabricData DeserializeDataReplicationFabricData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationFabricProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricProperties.DeserializeDataReplicationFabricProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs new file mode 100644 index 000000000000..7dd748dd5e0e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs @@ -0,0 +1,83 @@ +// 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 DataReplicationFabric data model. + /// Fabric model. + /// + public partial class DataReplicationFabricData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DataReplicationFabricData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DataReplicationFabricProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricData() + { + } + + /// The resource-specific properties for this resource. + public DataReplicationFabricProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs new file mode 100644 index 000000000000..fe9c63293abd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationFabricData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationFabricData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs new file mode 100644 index 000000000000..9f7c3ca2318e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationFabric 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 GetDataReplicationFabricResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationFabric method. + /// + public partial class DataReplicationFabricResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + 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 _dataReplicationFabricFabricClientDiagnostics; + private readonly FabricRestOperations _dataReplicationFabricFabricRestClient; + private readonly DataReplicationFabricData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationFabricResource(ArmClient client, DataReplicationFabricData 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 DataReplicationFabricResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationFabricFabricApiVersion); + _dataReplicationFabricFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricFabricApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationFabricData 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 DataReplicationFabricAgentResources in the DataReplicationFabric. + /// An object representing collection of DataReplicationFabricAgentResources and their operations over a DataReplicationFabricAgentResource. + public virtual DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() + { + return GetCachedClient(client => new DataReplicationFabricAgentCollection(client, Id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationFabricAgents().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 + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationFabricAgent(string fabricAgentName, CancellationToken cancellationToken = default) + { + return GetDataReplicationFabricAgents().Get(fabricAgentName, cancellationToken); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(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 + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.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 + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.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 + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.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 + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.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; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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 + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.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 = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + 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/DataReplicationJobCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs new file mode 100644 index 000000000000..9882bcf22856 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationJobs method from an instance of . + /// + public partial class DataReplicationJobCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationJobJobClientDiagnostics; + private readonly JobRestOperations _dataReplicationJobJobRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationJobCollection() + { + } + + /// 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 DataReplicationJobCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationJobJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationJobResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationJobResource.ResourceType, out string dataReplicationJobJobApiVersion); + _dataReplicationJobJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationJobJobApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job 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 = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job 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 = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(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 + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationJobJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationJobJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationJobResource(Client, DataReplicationJobData.DeserializeDataReplicationJobData(e)), _dataReplicationJobJobClientDiagnostics, Pipeline, "DataReplicationJobCollection.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 + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationJobJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationJobJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationJobResource(Client, DataReplicationJobData.DeserializeDataReplicationJobData(e)), _dataReplicationJobJobClientDiagnostics, Pipeline, "DataReplicationJobCollection.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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job 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 = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job 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 = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs new file mode 100644 index 000000000000..318ccb4c5a83 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationJobData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobData(document.RootElement, options); + } + + internal static DataReplicationJobData DeserializeDataReplicationJobData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationJobProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationJobProperties.DeserializeDataReplicationJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationJobData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs new file mode 100644 index 000000000000..64ac143311e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationJob data model. + /// Job model. + /// + public partial class DataReplicationJobData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationJobData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationJobProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs new file mode 100644 index 000000000000..7a4c0ee0e90c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationJobResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs new file mode 100644 index 000000000000..e8ff5fbc24d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationJob 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 GetDataReplicationJobResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationJob method. + /// + public partial class DataReplicationJobResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The jobName. + 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 _dataReplicationJobJobClientDiagnostics; + private readonly JobRestOperations _dataReplicationJobJobRestClient; + private readonly DataReplicationJobData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/jobs"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationJobResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationJobResource(ArmClient client, DataReplicationJobData 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 DataReplicationJobResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationJobJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationJobJobApiVersion); + _dataReplicationJobJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationJobJobApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationJobData 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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.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 DataReplicationJobResource(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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs new file mode 100644 index 000000000000..9bf439154997 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationPolicies method from an instance of . + /// + public partial class DataReplicationPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPolicyPolicyClientDiagnostics; + private readonly PolicyRestOperations _dataReplicationPolicyPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPolicyCollection() + { + } + + /// 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 DataReplicationPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPolicyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPolicyResource.ResourceType, out string dataReplicationPolicyPolicyApiVersion); + _dataReplicationPolicyPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPolicyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(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 + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPolicyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPolicyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPolicyResource(Client, DataReplicationPolicyData.DeserializeDataReplicationPolicyData(e)), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, "DataReplicationPolicyCollection.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 + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPolicyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPolicyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPolicyResource(Client, DataReplicationPolicyData.DeserializeDataReplicationPolicyData(e)), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, "DataReplicationPolicyCollection.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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs new file mode 100644 index 000000000000..421d9f8b50b7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPolicyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyData(document.RootElement, options); + } + + internal static DataReplicationPolicyData DeserializeDataReplicationPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPolicyProperties.DeserializeDataReplicationPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPolicyData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs new file mode 100644 index 000000000000..acce053623d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPolicy data model. + /// Policy model. + /// + public partial class DataReplicationPolicyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPolicyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs new file mode 100644 index 000000000000..585c75b9f878 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs new file mode 100644 index 000000000000..1e5f0980a46c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPolicy 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 GetDataReplicationPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPolicy method. + /// + public partial class DataReplicationPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The policyName. + 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 _dataReplicationPolicyPolicyClientDiagnostics; + private readonly PolicyRestOperations _dataReplicationPolicyPolicyRestClient; + private readonly DataReplicationPolicyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationPolicies"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPolicyResource(ArmClient client, DataReplicationPolicyData 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 DataReplicationPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPolicyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPolicyPolicyApiVersion); + _dataReplicationPolicyPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPolicyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPolicyData 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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.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 DataReplicationPolicyResource(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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(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 + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.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 + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.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 + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..300722d92cd0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationPrivateEndpointConnections method from an instance of . + /// + public partial class DataReplicationPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionCollection() + { + } + + /// 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 DataReplicationPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateEndpointConnectionResource.ResourceType, out string dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionResource(Client, DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(e)), _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionResource(Client, DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(e)), _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..6b8ca54aaddd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionData DeserializeDataReplicationPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateEndpointConnectionProperties.DeserializeDataReplicationPrivateEndpointConnectionProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..11a877d0e212 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateEndpointConnection data model. + /// Represents private endpoint connection. + /// + public partial class DataReplicationPrivateEndpointConnectionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateEndpointConnectionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateEndpointConnectionProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..e50b05a62f8c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationPrivateEndpointConnectionProxies method from an instance of . + /// + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionProxyCollection() + { + } + + /// 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 DataReplicationPrivateEndpointConnectionProxyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateEndpointConnectionProxyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateEndpointConnectionProxyResource.ResourceType, out string dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionProxyResource(Client, DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(e)), _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionProxyResource(Client, DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(e)), _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, 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}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs new file mode 100644 index 000000000000..c576864b5d8e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionProxyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + } + + DataReplicationPrivateEndpointConnectionProxyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProxyData DeserializeDataReplicationPrivateEndpointConnectionProxyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionProxyProperties properties = default; + ETag? etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateEndpointConnectionProxyProperties.DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(property.Value, options); + continue; + } + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProxyData( + id, + name, + type, + systemData, + properties, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs new file mode 100644 index 000000000000..082924082ed2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateEndpointConnectionProxy data model. + /// Represents private endpoint connection proxy request. + /// + public partial class DataReplicationPrivateEndpointConnectionProxyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProxyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProxyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateEndpointConnectionProxyProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateEndpointConnectionProxyProperties Properties { get; set; } + /// Gets or sets ETag. + public ETag? ETag { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs new file mode 100644 index 000000000000..25dea4384794 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionProxyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateEndpointConnectionProxyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationPrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..4bcac0c15bab --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateEndpointConnectionProxy 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 GetDataReplicationPrivateEndpointConnectionProxyResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateEndpointConnectionProxy method. + /// + public partial class DataReplicationPrivateEndpointConnectionProxyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionProxyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient; + private readonly DataReplicationPrivateEndpointConnectionProxyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnectionProxies"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionProxyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionProxyResource(ArmClient client, DataReplicationPrivateEndpointConnectionProxyData 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 DataReplicationPrivateEndpointConnectionProxyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateEndpointConnectionProxyData 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 private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.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 DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.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; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.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; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateAsync(DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual Response Validate(DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs new file mode 100644 index 000000000000..1363afaa58b7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..cb86be109a33 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateEndpointConnection 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 GetDataReplicationPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateEndpointConnection method. + /// + public partial class DataReplicationPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly DataReplicationPrivateEndpointConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnections"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionResource(ArmClient client, DataReplicationPrivateEndpointConnectionData 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 DataReplicationPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateEndpointConnectionData 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 private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.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 DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.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 private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.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; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + 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/DataReplicationPrivateLinkResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..57bf0cbd19c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs new file mode 100644 index 000000000000..82229fe52243 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateLinkResource 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 GetDataReplicationPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateLinkResource method. + /// + public partial class DataReplicationPrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient; + private readonly DataReplicationPrivateLinkResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateLinkResource(ArmClient client, DataReplicationPrivateLinkResourceData 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 DataReplicationPrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); + _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateLinkResourceData 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 site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.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 DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..ec9128bba49f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationPrivateLinkResources method from an instance of . + /// + public partial class DataReplicationPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateLinkResourceCollection() + { + } + + /// 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 DataReplicationPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateLinkResource.ResourceType, out string dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); + _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link 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 privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateLinkResource(Client, DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(e)), _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics, Pipeline, "DataReplicationPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateLinkResource(Client, DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(e)), _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics, Pipeline, "DataReplicationPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link 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 privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, 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}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs new file mode 100644 index 000000000000..790d0dd91ec0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateLinkResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkResourceData(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkResourceData DeserializeDataReplicationPrivateLinkResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateLinkResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateLinkResourceProperties.DeserializeDataReplicationPrivateLinkResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs new file mode 100644 index 000000000000..242cd05cb8ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateLinkResource data model. + /// Represents private link resource. + /// + public partial class DataReplicationPrivateLinkResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationPrivateLinkResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateLinkResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateLinkResourceProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs new file mode 100644 index 000000000000..e26b49bca18d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationProtectedItems method from an instance of . + /// + public partial class DataReplicationProtectedItemCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationProtectedItemProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _dataReplicationProtectedItemProtectedItemRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationProtectedItemCollection() + { + } + + /// 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 DataReplicationProtectedItemCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationProtectedItemProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationProtectedItemResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationProtectedItemResource.ResourceType, out string dataReplicationProtectedItemProtectedItemApiVersion); + _dataReplicationProtectedItemProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationProtectedItemProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(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 + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationProtectedItemResource(Client, DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(e)), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, "DataReplicationProtectedItemCollection.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 + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationProtectedItemResource(Client, DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(e)), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, "DataReplicationProtectedItemCollection.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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs new file mode 100644 index 000000000000..1b2fc020898b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationProtectedItemData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationProtectedItemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemData(document.RootElement, options); + } + + internal static DataReplicationProtectedItemData DeserializeDataReplicationProtectedItemData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationProtectedItemProperties.DeserializeDataReplicationProtectedItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs new file mode 100644 index 000000000000..98d07e1183ab --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationProtectedItem data model. + /// Protected item model. + /// + public partial class DataReplicationProtectedItemData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationProtectedItemProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationProtectedItemProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs new file mode 100644 index 000000000000..b423075e2953 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationProtectedItemResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationProtectedItemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationProtectedItemData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs new file mode 100644 index 000000000000..d610ccf560fc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationProtectedItem 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 GetDataReplicationProtectedItemResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationProtectedItem method. + /// + public partial class DataReplicationProtectedItemResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + 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 _dataReplicationProtectedItemProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _dataReplicationProtectedItemProtectedItemRestClient; + private readonly DataReplicationProtectedItemData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationProtectedItemResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationProtectedItemResource(ArmClient client, DataReplicationProtectedItemData 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 DataReplicationProtectedItemResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationProtectedItemProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationProtectedItemProtectedItemApiVersion); + _dataReplicationProtectedItemProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationProtectedItemProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationProtectedItemData 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 DataReplicationRecoveryPointResources in the DataReplicationProtectedItem. + /// An object representing collection of DataReplicationRecoveryPointResources and their operations over a DataReplicationRecoveryPointResource. + public virtual DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() + { + return GetCachedClient(client => new DataReplicationRecoveryPointCollection(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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationRecoveryPoints().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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationRecoveryPoint(string recoveryPointName, CancellationToken cancellationToken = default) + { + return GetDataReplicationRecoveryPoints().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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.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 DataReplicationProtectedItemResource(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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(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 + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.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 + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// 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 = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.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; + } + } + + /// + /// Performs update on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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 protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).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 + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual async Task> PlannedFailoverAsync(WaitUntil waitUntil, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.PlannedFailover"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.PlannedFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverOperationSource(), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.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 + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation PlannedFailover(WaitUntil waitUntil, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.PlannedFailover"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.PlannedFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverOperationSource(), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.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; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs new file mode 100644 index 000000000000..5eebe045bdf2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.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 GetDataReplicationRecoveryPoints method from an instance of . + /// + public partial class DataReplicationRecoveryPointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationRecoveryPointRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _dataReplicationRecoveryPointRecoveryPointRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationRecoveryPointCollection() + { + } + + /// 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 DataReplicationRecoveryPointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationRecoveryPointRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationRecoveryPointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationRecoveryPointResource.ResourceType, out string dataReplicationRecoveryPointRecoveryPointApiVersion); + _dataReplicationRecoveryPointRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationRecoveryPointRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationProtectedItemResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationProtectedItemResource.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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.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 DataReplicationRecoveryPointResource(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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.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 DataReplicationRecoveryPointResource(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 + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationRecoveryPointResource(Client, DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(e)), _dataReplicationRecoveryPointRecoveryPointClientDiagnostics, Pipeline, "DataReplicationRecoveryPointCollection.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 + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationRecoveryPointResource(Client, DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(e)), _dataReplicationRecoveryPointRecoveryPointClientDiagnostics, Pipeline, "DataReplicationRecoveryPointCollection.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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.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; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs new file mode 100644 index 000000000000..b4814f7a9157 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationRecoveryPointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationRecoveryPointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointData(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointData DeserializeDataReplicationRecoveryPointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationRecoveryPointProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationRecoveryPointProperties.DeserializeDataReplicationRecoveryPointProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationRecoveryPointData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs new file mode 100644 index 000000000000..b9c9609366a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationRecoveryPoint data model. + /// Recovery point model. + /// + public partial class DataReplicationRecoveryPointData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationRecoveryPointData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationRecoveryPointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationRecoveryPointProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs new file mode 100644 index 000000000000..4d8e79b1f9e8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationRecoveryPointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationRecoveryPointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationRecoveryPointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs new file mode 100644 index 000000000000..370e6ddb742b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationRecoveryPoint 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 GetDataReplicationRecoveryPointResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationRecoveryPoint method. + /// + public partial class DataReplicationRecoveryPointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + /// The recoveryPointName. + 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 _dataReplicationRecoveryPointRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _dataReplicationRecoveryPointRecoveryPointRestClient; + private readonly DataReplicationRecoveryPointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems/recoveryPoints"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationRecoveryPointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationRecoveryPointResource(ArmClient client, DataReplicationRecoveryPointData 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 DataReplicationRecoveryPointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationRecoveryPointRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationRecoveryPointRecoveryPointApiVersion); + _dataReplicationRecoveryPointRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationRecoveryPointRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationRecoveryPointData 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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.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 DataReplicationRecoveryPointResource(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 + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.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 DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs new file mode 100644 index 000000000000..2e720e1628e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.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 GetDataReplicationVaults method from an instance of . + /// + public partial class DataReplicationVaultCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; + private readonly VaultRestOperations _dataReplicationVaultVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationVaultCollection() + { + } + + /// 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 DataReplicationVaultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationVaultVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationVaultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationVaultResource.ResourceType, out string dataReplicationVaultVaultApiVersion); + _dataReplicationVaultVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationVaultVaultApiVersion); +#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 + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The 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, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(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 + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dataReplicationVaultVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationVaultVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), _dataReplicationVaultVaultClientDiagnostics, Pipeline, "DataReplicationVaultCollection.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 + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dataReplicationVaultVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationVaultVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), _dataReplicationVaultVaultClientDiagnostics, Pipeline, "DataReplicationVaultCollection.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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> GetIfExistsAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs new file mode 100644 index 000000000000..f924318e974f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationVaultData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + DataReplicationVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultData(document.RootElement, options); + } + + internal static DataReplicationVaultData DeserializeDataReplicationVaultData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationVaultProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationVaultProperties.DeserializeDataReplicationVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs new file mode 100644 index 000000000000..8cee6912a302 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs @@ -0,0 +1,87 @@ +// 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 DataReplicationVault data model. + /// Vault model. + /// + public partial class DataReplicationVaultData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DataReplicationVaultData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DataReplicationVaultProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationVaultData() + { + } + + /// The resource-specific properties for this resource. + public DataReplicationVaultProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs new file mode 100644 index 000000000000..55a01b42873d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationVaultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + DataReplicationVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs new file mode 100644 index 000000000000..2a5e07342d49 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs @@ -0,0 +1,1328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationVault 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 GetDataReplicationVaultResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationVault method. + /// + public partial class DataReplicationVaultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + 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 _dataReplicationVaultVaultClientDiagnostics; + private readonly VaultRestOperations _dataReplicationVaultVaultRestClient; + private readonly DataReplicationVaultData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationVaultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationVaultResource(ArmClient client, DataReplicationVaultData 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 DataReplicationVaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationVaultVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationVaultVaultApiVersion); + _dataReplicationVaultVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationVaultVaultApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationVaultData 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 DataReplicationEmailConfigurationResources in the DataReplicationVault. + /// An object representing collection of DataReplicationEmailConfigurationResources and their operations over a DataReplicationEmailConfigurationResource. + public virtual DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() + { + return GetCachedClient(client => new DataReplicationEmailConfigurationCollection(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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationEmailConfigurations().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 + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationEmailConfiguration(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return GetDataReplicationEmailConfigurations().Get(emailConfigurationName, cancellationToken); + } + + /// Gets a collection of DataReplicationEventResources in the DataReplicationVault. + /// An object representing collection of DataReplicationEventResources and their operations over a DataReplicationEventResource. + public virtual DataReplicationEventCollection GetDataReplicationEvents() + { + return GetCachedClient(client => new DataReplicationEventCollection(client, Id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationEventAsync(string eventName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationEvents().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 + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationEvent(string eventName, CancellationToken cancellationToken = default) + { + return GetDataReplicationEvents().Get(eventName, cancellationToken); + } + + /// Gets a collection of DataReplicationJobResources in the DataReplicationVault. + /// An object representing collection of DataReplicationJobResources and their operations over a DataReplicationJobResource. + public virtual DataReplicationJobCollection GetDataReplicationJobs() + { + return GetCachedClient(client => new DataReplicationJobCollection(client, Id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationJobAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationJobs().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 + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationJob(string jobName, CancellationToken cancellationToken = default) + { + return GetDataReplicationJobs().Get(jobName, cancellationToken); + } + + /// Gets a collection of DataReplicationPolicyResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPolicyResources and their operations over a DataReplicationPolicyResource. + public virtual DataReplicationPolicyCollection GetDataReplicationPolicies() + { + return GetCachedClient(client => new DataReplicationPolicyCollection(client, Id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPolicyAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPolicies().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 + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPolicy(string policyName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPolicies().Get(policyName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateEndpointConnectionResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateEndpointConnectionResources and their operations over a DataReplicationPrivateEndpointConnectionResource. + public virtual DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() + { + return GetCachedClient(client => new DataReplicationPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateEndpointConnectionProxyResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateEndpointConnectionProxyResources and their operations over a DataReplicationPrivateEndpointConnectionProxyResource. + public virtual DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() + { + return GetCachedClient(client => new DataReplicationPrivateEndpointConnectionProxyCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateEndpointConnectionProxies().GetAsync(privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateEndpointConnectionProxies().Get(privateEndpointConnectionProxyName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateLinkResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateLinkResources and their operations over a DataReplicationPrivateLinkResource. + public virtual DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() + { + return GetCachedClient(client => new DataReplicationPrivateLinkResourceCollection(client, Id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateLinkResources().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateLinkResources().Get(privateLinkResourceName, cancellationToken); + } + + /// Gets a collection of DataReplicationProtectedItemResources in the DataReplicationVault. + /// An object representing collection of DataReplicationProtectedItemResources and their operations over a DataReplicationProtectedItemResource. + public virtual DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() + { + return GetCachedClient(client => new DataReplicationProtectedItemCollection(client, Id)); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationProtectedItemAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationProtectedItems().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 + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationProtectedItem(string protectedItemName, CancellationToken cancellationToken = default) + { + return GetDataReplicationProtectedItems().Get(protectedItemName, cancellationToken); + } + + /// Gets a collection of DataReplicationExtensionResources in the DataReplicationVault. + /// An object representing collection of DataReplicationExtensionResources and their operations over a DataReplicationExtensionResource. + public virtual DataReplicationExtensionCollection GetDataReplicationExtensions() + { + return GetCachedClient(client => new DataReplicationExtensionCollection(client, Id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationExtensionAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationExtensions().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 + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationExtension(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return GetDataReplicationExtensions().Get(replicationExtensionName, cancellationToken); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(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 + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.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 + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.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 + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.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 + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.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; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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 + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.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 = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + 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/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs new file mode 100644 index 000000000000..c32531744ad8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableRecoveryServicesDataReplicationArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationArmClient() + { + } + + /// 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 MockableRecoveryServicesDataReplicationArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableRecoveryServicesDataReplicationArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(ResourceIdentifier id) + { + DataReplicationEmailConfigurationResource.ValidateResourceId(id); + return new DataReplicationEmailConfigurationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationVaultResource GetDataReplicationVaultResource(ResourceIdentifier id) + { + DataReplicationVaultResource.ValidateResourceId(id); + return new DataReplicationVaultResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationEventResource GetDataReplicationEventResource(ResourceIdentifier id) + { + DataReplicationEventResource.ValidateResourceId(id); + return new DataReplicationEventResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationFabricResource GetDataReplicationFabricResource(ResourceIdentifier id) + { + DataReplicationFabricResource.ValidateResourceId(id); + return new DataReplicationFabricResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(ResourceIdentifier id) + { + DataReplicationFabricAgentResource.ValidateResourceId(id); + return new DataReplicationFabricAgentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationJobResource GetDataReplicationJobResource(ResourceIdentifier id) + { + DataReplicationJobResource.ValidateResourceId(id); + return new DataReplicationJobResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPolicyResource GetDataReplicationPolicyResource(ResourceIdentifier id) + { + DataReplicationPolicyResource.ValidateResourceId(id); + return new DataReplicationPolicyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DataReplicationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DataReplicationPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(ResourceIdentifier id) + { + DataReplicationPrivateEndpointConnectionProxyResource.ValidateResourceId(id); + return new DataReplicationPrivateEndpointConnectionProxyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(ResourceIdentifier id) + { + DataReplicationPrivateLinkResource.ValidateResourceId(id); + return new DataReplicationPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(ResourceIdentifier id) + { + DataReplicationProtectedItemResource.ValidateResourceId(id); + return new DataReplicationProtectedItemResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(ResourceIdentifier id) + { + DataReplicationRecoveryPointResource.ValidateResourceId(id); + return new DataReplicationRecoveryPointResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationExtensionResource GetDataReplicationExtensionResource(ResourceIdentifier id) + { + DataReplicationExtensionResource.ValidateResourceId(id); + return new DataReplicationExtensionResource(Client, id); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs new file mode 100644 index 000000000000..b312d29bee88 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs @@ -0,0 +1,262 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : ArmResource + { + private ClientDiagnostics _deploymentPreflightClientDiagnostics; + private DeploymentPreflightRestOperations _deploymentPreflightRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationResourceGroupResource() + { + } + + /// 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 MockableRecoveryServicesDataReplicationResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DeploymentPreflightClientDiagnostics => _deploymentPreflightClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private DeploymentPreflightRestOperations DeploymentPreflightRestClient => _deploymentPreflightRestClient ??= new DeploymentPreflightRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. + public virtual DataReplicationVaultCollection GetDataReplicationVaults() + { + return GetCachedClient(client => new DataReplicationVaultCollection(client, Id)); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetDataReplicationVaults().Get(vaultName, cancellationToken); + } + + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. + public virtual DataReplicationFabricCollection GetDataReplicationFabrics() + { + return GetCachedClient(client => new DataReplicationFabricCollection(client, Id)); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationFabricAsync(string fabricName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationFabrics().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationFabric(string fabricName, CancellationToken cancellationToken = default) + { + return GetDataReplicationFabrics().Get(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> PostDeploymentPreflightAsync(string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = await DeploymentPreflightRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response PostDeploymentPreflight(string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = DeploymentPreflightRestClient.Post(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/MockableRecoveryServicesDataReplicationSubscriptionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs new file mode 100644 index 000000000000..9d361158821e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs @@ -0,0 +1,245 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : ArmResource + { + private ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; + private VaultRestOperations _dataReplicationVaultVaultRestClient; + private ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; + private FabricRestOperations _dataReplicationFabricFabricRestClient; + private ClientDiagnostics _checkNameAvailabilityClientDiagnostics; + private CheckNameAvailabilityRestOperations _checkNameAvailabilityRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationSubscriptionResource() + { + } + + /// 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 MockableRecoveryServicesDataReplicationSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DataReplicationVaultVaultClientDiagnostics => _dataReplicationVaultVaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationVaultResource.ResourceType.Namespace, Diagnostics); + private VaultRestOperations DataReplicationVaultVaultRestClient => _dataReplicationVaultVaultRestClient ??= new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataReplicationVaultResource.ResourceType)); + private ClientDiagnostics DataReplicationFabricFabricClientDiagnostics => _dataReplicationFabricFabricClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricResource.ResourceType.Namespace, Diagnostics); + private FabricRestOperations DataReplicationFabricFabricRestClient => _dataReplicationFabricFabricRestClient ??= new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataReplicationFabricResource.ResourceType)); + private ClientDiagnostics CheckNameAvailabilityClientDiagnostics => _checkNameAvailabilityClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CheckNameAvailabilityRestOperations CheckNameAvailabilityRestClient => _checkNameAvailabilityRestClient ??= new CheckNameAvailabilityRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDataReplicationVaultsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDataReplicationVaults(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDataReplicationFabricsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDataReplicationFabrics(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual async Task> PostCheckNameAvailabilityAsync(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = await CheckNameAvailabilityRestClient.PostAsync(Id.SubscriptionId, location, content, 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_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual Response PostCheckNameAvailability(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = CheckNameAvailabilityRestClient.Post(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + 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..fbe3ad443a0f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs @@ -0,0 +1,747 @@ +// 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.Core; +using Azure.ResourceManager.RecoveryServicesDataReplication.Mocking; +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 MockableRecoveryServicesDataReplicationArmClient GetMockableRecoveryServicesDataReplicationArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableRecoveryServicesDataReplicationArmClient(client0)); + } + + private static MockableRecoveryServicesDataReplicationResourceGroupResource GetMockableRecoveryServicesDataReplicationResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationResourceGroupResource(client, resource.Id)); + } + + private static MockableRecoveryServicesDataReplicationSubscriptionResource GetMockableRecoveryServicesDataReplicationSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationEmailConfigurationResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationVaultResource GetDataReplicationVaultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationVaultResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationEventResource GetDataReplicationEventResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationEventResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationFabricResource GetDataReplicationFabricResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationFabricResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationFabricAgentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationJobResource GetDataReplicationJobResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationJobResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPolicyResource GetDataReplicationPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPolicyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateEndpointConnectionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateEndpointConnectionProxyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateLinkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationProtectedItemResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationRecoveryPointResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationExtensionResource GetDataReplicationExtensionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationExtensionResource(id); + } + + /// + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. + public static DataReplicationVaultCollection GetDataReplicationVaults(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVaults(); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDataReplicationVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDataReplicationVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVault(vaultName, cancellationToken); + } + + /// + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. + public static DataReplicationFabricCollection GetDataReplicationFabrics(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabrics(); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDataReplicationFabricAsync(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabricAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDataReplicationFabric(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabric(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// 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. + /// or is null. + public static async Task> PostDeploymentPreflightAsync(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// 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. + /// or is null. + public static Response PostDeploymentPreflight(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflight(deploymentId, body, cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDataReplicationVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationVaultsAsync(cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDataReplicationVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationVaults(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDataReplicationFabricsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationFabricsAsync(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDataReplicationFabrics(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationFabrics(cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static async Task> PostCheckNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static Response PostCheckNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailability(location, content, cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..9c62a091425c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..c13f7c82b016 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e0c7e0652299 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// 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.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..974ccc05ea48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..9843364940f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..97644ff6907d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs new file mode 100644 index 000000000000..329de5f2f118 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationExtensionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationExtensionOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationExtensionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationExtensionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationExtensionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs new file mode 100644 index 000000000000..8344e0fa2731 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationFabricAgentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationFabricAgentOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationFabricAgentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationFabricAgentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationFabricAgentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs new file mode 100644 index 000000000000..47e0b72fa2c3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationFabricOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationFabricOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationFabricResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationFabricResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationFabricResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs new file mode 100644 index 000000000000..68110eac8c92 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationPolicyOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationPolicyResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs new file mode 100644 index 000000000000..12783fc3deae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationProtectedItemOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationProtectedItemOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationProtectedItemResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationProtectedItemResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationProtectedItemResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs new file mode 100644 index 000000000000..e377c7dabf03 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationVaultOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationVaultOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationVaultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return new DataReplicationVaultResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + return await Task.FromResult(new DataReplicationVaultResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs new file mode 100644 index 000000000000..54337341ad59 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class PlannedFailoverOperationSource : IOperationSource + { + PlannedFailover IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return PlannedFailover.DeserializePlannedFailover(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return PlannedFailover.DeserializePlannedFailover(document.RootElement); + } + } +} 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..10ac0e252450 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +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; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + 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); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + 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..f5215c5882d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +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; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal RecoveryServicesDataReplicationArmOperation(IOperationSource source, 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); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerRecoveryServicesDataReplicationContext.Default).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + 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/Models/AzStackHciClusterProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs new file mode 100644 index 000000000000..f7b9ff741a97 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHciClusterProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support writing '{format}' format."); + } + + 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, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzStackHciClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHciClusterProperties(document.RootElement, options); + } + + internal static AzStackHciClusterProperties DeserializeAzStackHciClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterName = default; + string resourceName = default; + string storageAccountName = default; + IList storageContainers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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, options)); + } + storageContainers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHciClusterProperties(clusterName, resourceName, storageAccountName, storageContainers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHciClusterProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzStackHciClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..5f62eabc122e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI cluster properties. + public partial class AzStackHciClusterProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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 . + /// 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. + /// Keeps track of any properties unknown to the library. + internal AzStackHciClusterProperties(string clusterName, string resourceName, string storageAccountName, IList storageContainers, IDictionary serializedAdditionalRawData) + { + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHciClusterProperties() + { + } + + /// 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/AzStackHciFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..297998237e66 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHciFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + if (options.Format != "W" && Optional.IsCollectionDefined(ApplianceName)) + { + writer.WritePropertyName("applianceName"u8); + writer.WriteStartArray(); + foreach (var item in ApplianceName) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("cluster"u8); + writer.WriteObjectValue(Cluster, options); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri.AbsoluteUri); + } + } + + AzStackHciFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHciFabricCustomProperties(document.RootElement, options); + } + + internal static AzStackHciFabricCustomProperties DeserializeAzStackHciFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier azStackHciSiteId = default; + IReadOnlyList applianceName = default; + AzStackHciClusterProperties cluster = default; + ResourceIdentifier fabricResourceId = default; + ResourceIdentifier fabricContainerId = default; + ResourceIdentifier migrationSolutionId = default; + Uri migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = new ResourceIdentifier(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, options); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHciFabricCustomProperties( + instanceType, + serializedAdditionalRawData, + azStackHciSiteId, + applianceName ?? new ChangeTrackingList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHciFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzStackHciFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs new file mode 100644 index 000000000000..f095e0960f8b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI fabric model custom properties. + public partial class AzStackHciFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// 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 AzStackHciFabricCustomProperties(ResourceIdentifier azStackHciSiteId, AzStackHciClusterProperties cluster, ResourceIdentifier 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 . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 AzStackHciFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier azStackHciSiteId, IReadOnlyList applianceName, AzStackHciClusterProperties cluster, ResourceIdentifier fabricResourceId, ResourceIdentifier fabricContainerId, ResourceIdentifier migrationSolutionId, Uri migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = applianceName; + Cluster = cluster; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "AzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHciFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier 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 ResourceIdentifier FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public ResourceIdentifier FabricContainerId { get; } + /// Gets or sets the Migration solution ARM Id. + public ResourceIdentifier 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/AzureResourceManagerRecoveryServicesDataReplicationContext.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzureResourceManagerRecoveryServicesDataReplicationContext.cs new file mode 100644 index 000000000000..804289d20bb7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzureResourceManagerRecoveryServicesDataReplicationContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class AzureResourceManagerRecoveryServicesDataReplicationContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs new file mode 100644 index 000000000000..24853ed99f11 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationDiskControllerInputs : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("controllerName"u8); + writer.WriteStringValue(ControllerName); + writer.WritePropertyName("controllerId"u8); + writer.WriteNumberValue(ControllerId); + writer.WritePropertyName("controllerLocation"u8); + writer.WriteNumberValue(ControllerLocation); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationDiskControllerInputs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationDiskControllerInputs(document.RootElement, options); + } + + internal static DataReplicationDiskControllerInputs DeserializeDataReplicationDiskControllerInputs(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string controllerName = default; + int controllerId = default; + int controllerLocation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("controllerName"u8)) + { + controllerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("controllerId"u8)) + { + controllerId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("controllerLocation"u8)) + { + controllerLocation = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationDiskControllerInputs(controllerName, controllerId, controllerLocation, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationDiskControllerInputs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationDiskControllerInputs(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs new file mode 100644 index 000000000000..ea674a43355a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Disk controller. + public partial class DataReplicationDiskControllerInputs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// is null. + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) + { + Argument.AssertNotNull(controllerName, nameof(controllerName)); + + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + } + + /// Initializes a new instance of . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// Keeps track of any properties unknown to the library. + internal DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation, IDictionary serializedAdditionalRawData) + { + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationDiskControllerInputs() + { + } + + /// Gets or sets the controller name (IDE,SCSI). + public string ControllerName { get; set; } + /// Gets or sets the controller ID. + public int ControllerId { get; set; } + /// Gets or sets the controller Location. + public int ControllerLocation { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..a9dd47d93fcd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationEmailConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support writing '{format}' format."); + } + + 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); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEmailConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEmailConfigurationProperties(document.RootElement, options); + } + + internal static DataReplicationEmailConfigurationProperties DeserializeDataReplicationEmailConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool sendToOwners = default; + IList customEmailAddresses = default; + string locale = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEmailConfigurationProperties(sendToOwners, customEmailAddresses ?? new ChangeTrackingList(), locale, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEmailConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEmailConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs new file mode 100644 index 000000000000..9a926bc395d1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Email configuration model properties. + public partial class DataReplicationEmailConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + public DataReplicationEmailConfigurationProperties(bool sendToOwners) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets the provisioning state of the email configuration. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEmailConfigurationProperties(bool sendToOwners, IList customEmailAddresses, string locale, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = customEmailAddresses; + Locale = locale; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationEmailConfigurationProperties() + { + } + + /// 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; } + /// Gets or sets the provisioning state of the email configuration. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs new file mode 100644 index 000000000000..8fef33c425ef --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationErrorInfo(document.RootElement, options); + } + + internal static DataReplicationErrorInfo DeserializeDataReplicationErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string type = default; + string severity = default; + DateTimeOffset? creationTime = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationErrorInfo( + code, + type, + severity, + creationTime, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs new file mode 100644 index 000000000000..613811120831 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Error model. + public partial class DataReplicationErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationErrorInfo() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal DataReplicationErrorInfo(string code, string type, string severity, DateTimeOffset? createdOn, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + Type = type; + Severity = severity; + CreatedOn = createdOn; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the error type. + public string Type { 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/DataReplicationEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..69dabcd2d2b4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationEventCustomProperties))] + public partial class DataReplicationEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + + internal static DataReplicationEventCustomProperties DeserializeDataReplicationEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciEventCustomProperties.DeserializeHyperVToAzStackHciEventCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciEventCustomProperties.DeserializeVMwareToAzStackHciEventCustomProperties(element, options); + } + } + return UnknownDataReplicationEventCustomProperties.DeserializeUnknownDataReplicationEventCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs new file mode 100644 index 000000000000..126a7bb82a8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 and . + /// + public abstract partial class DataReplicationEventCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationEventCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationEventCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs new file mode 100644 index 000000000000..e8f5f380e9c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationEventProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResourceName)) + { + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + } + if (options.Format != "W" && Optional.IsDefined(EventType)) + { + writer.WritePropertyName("eventType"u8); + writer.WriteStringValue(EventType); + } + if (options.Format != "W" && Optional.IsDefined(EventName)) + { + writer.WritePropertyName("eventName"u8); + writer.WriteStringValue(EventName); + } + if (options.Format != "W" && Optional.IsDefined(OccurredOn)) + { + writer.WritePropertyName("timeOfOccurrence"u8); + writer.WriteStringValue(OccurredOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventProperties(document.RootElement, options); + } + + internal static DataReplicationEventProperties DeserializeDataReplicationEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType? resourceType = default; + string resourceName = default; + string eventType = default; + string eventName = default; + DateTimeOffset? timeOfOccurrence = default; + string severity = default; + string description = default; + string correlationId = default; + IReadOnlyList healthErrors = default; + DataReplicationEventCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new 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(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationEventCustomProperties.DeserializeDataReplicationEventCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEventProperties( + resourceType, + resourceName, + eventType, + eventName, + timeOfOccurrence, + severity, + description, + correlationId, + healthErrors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs new file mode 100644 index 000000000000..3a3d603768bd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs @@ -0,0 +1,129 @@ +// 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 DataReplicationEventProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// 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 and . + /// + /// is null. + internal DataReplicationEventProperties(DataReplicationEventCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// 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 and . + /// + /// Gets or sets the provisioning state of the event. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventProperties(ResourceType? resourceType, string resourceName, string eventType, string eventName, DateTimeOffset? occurredOn, string severity, string description, string correlationId, IReadOnlyList healthErrors, DataReplicationEventCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + ResourceName = resourceName; + EventType = eventType; + EventName = eventName; + OccurredOn = occurredOn; + Severity = severity; + Description = description; + CorrelationId = correlationId; + HealthErrors = healthErrors; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationEventProperties() + { + } + + /// Gets or sets the resource type. + public ResourceType? 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? OccurredOn { 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 and . + /// + public DataReplicationEventCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the event. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e506314a485e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationExtensionCustomProperties))] + public partial class DataReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static DataReplicationExtensionCustomProperties DeserializeDataReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciReplicationExtensionCustomProperties.DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciReplicationExtensionCustomProperties.DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(element, options); + } + } + return UnknownDataReplicationExtensionCustomProperties.DeserializeUnknownDataReplicationExtensionCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..bced10ed844b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 DataReplicationExtensionCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationExtensionCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationExtensionCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs new file mode 100644 index 000000000000..7e61ff6583f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationExtensionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionProperties(document.RootElement, options); + } + + internal static DataReplicationExtensionProperties DeserializeDataReplicationExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + DataReplicationExtensionCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationExtensionCustomProperties.DeserializeDataReplicationExtensionCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationExtensionProperties(provisioningState, customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs new file mode 100644 index 000000000000..3d6dc50fae7c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Replication extension model properties. + public partial class DataReplicationExtensionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// 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 DataReplicationExtensionProperties(DataReplicationExtensionCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionProperties(DataReplicationProvisioningState? provisioningState, DataReplicationExtensionCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationExtensionProperties() + { + } + + /// Gets or sets the provisioning state of the replication extension. + public DataReplicationProvisioningState? 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 DataReplicationExtensionCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..dcb4ca0dcd9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationFabricAgentCustomProperties))] + public partial class DataReplicationFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + + internal static DataReplicationFabricAgentCustomProperties DeserializeDataReplicationFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "VMware": return VMwareFabricAgentCustomProperties.DeserializeVMwareFabricAgentCustomProperties(element, options); + } + } + return UnknownDataReplicationFabricAgentCustomProperties.DeserializeUnknownDataReplicationFabricAgentCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..d95e02cfee41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Fabric agent 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 DataReplicationFabricAgentCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationFabricAgentCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs new file mode 100644 index 000000000000..bf658f9cc3ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricAgentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + writer.WritePropertyName("machineId"u8); + writer.WriteStringValue(MachineId); + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("authenticationIdentity"u8); + writer.WriteObjectValue(AuthenticationIdentity, options); + writer.WritePropertyName("resourceAccessIdentity"u8); + writer.WriteObjectValue(ResourceAccessIdentity, options); + if (options.Format != "W" && Optional.IsDefined(IsResponsive)) + { + writer.WritePropertyName("isResponsive"u8); + writer.WriteBooleanValue(IsResponsive.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastHeartbeatOn)) + { + writer.WritePropertyName("lastHeartbeat"u8); + writer.WriteStringValue(LastHeartbeatOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(VersionNumber)) + { + writer.WritePropertyName("versionNumber"u8); + writer.WriteStringValue(VersionNumber); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricAgentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentProperties(document.RootElement, options); + } + + internal static DataReplicationFabricAgentProperties DeserializeDataReplicationFabricAgentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string correlationId = default; + string machineId = default; + string machineName = default; + DataReplicationIdentity authenticationIdentity = default; + DataReplicationIdentity resourceAccessIdentity = default; + bool? isResponsive = default; + DateTimeOffset? lastHeartbeat = default; + string versionNumber = default; + DataReplicationProvisioningState? provisioningState = default; + IReadOnlyList healthErrors = default; + DataReplicationFabricAgentCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + continue; + } + if (property.NameEquals("resourceAccessIdentity"u8)) + { + resourceAccessIdentity = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + 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 DataReplicationProvisioningState(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(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationFabricAgentCustomProperties.DeserializeDataReplicationFabricAgentCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricAgentProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeat, + versionNumber, + provisioningState, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs new file mode 100644 index 000000000000..ca2228a4d0da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric agent model properties. + public partial class DataReplicationFabricAgentProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// + /// Fabric agent 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 DataReplicationFabricAgentProperties(string machineId, string machineName, DataReplicationIdentity authenticationIdentity, DataReplicationIdentity resourceAccessIdentity, DataReplicationFabricAgentCustomProperties 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 . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentProperties(string correlationId, string machineId, string machineName, DataReplicationIdentity authenticationIdentity, DataReplicationIdentity resourceAccessIdentity, bool? isResponsive, DateTimeOffset? lastHeartbeatOn, string versionNumber, DataReplicationProvisioningState? provisioningState, IReadOnlyList healthErrors, DataReplicationFabricAgentCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CorrelationId = correlationId; + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + IsResponsive = isResponsive; + LastHeartbeatOn = lastHeartbeatOn; + VersionNumber = versionNumber; + ProvisioningState = provisioningState; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricAgentProperties() + { + } + + /// Gets or sets the fabric agent correlation Id. + public string CorrelationId { get; } + /// Gets or sets the machine Id where fabric agent is running. + public string MachineId { get; set; } + /// Gets or sets the machine name where fabric agent is running. + public string MachineName { get; set; } + /// Identity model. + public DataReplicationIdentity AuthenticationIdentity { get; set; } + /// Identity model. + public DataReplicationIdentity ResourceAccessIdentity { get; set; } + /// Gets or sets a value indicating whether the fabric agent is responsive. + public bool? IsResponsive { get; } + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + public DateTimeOffset? LastHeartbeatOn { get; } + /// Gets or sets the fabric agent version. + public string VersionNumber { get; } + /// Gets or sets the provisioning state of the fabric agent. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric agent 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 DataReplicationFabricAgentCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..7295739df8bc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationFabricCustomProperties))] + public partial class DataReplicationFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + + internal static DataReplicationFabricCustomProperties DeserializeDataReplicationFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzStackHCI": return AzStackHciFabricCustomProperties.DeserializeAzStackHciFabricCustomProperties(element, options); + case "HyperVMigrate": return HyperVMigrateFabricCustomProperties.DeserializeHyperVMigrateFabricCustomProperties(element, options); + case "VMwareMigrate": return VMwareMigrateFabricCustomProperties.DeserializeVMwareMigrateFabricCustomProperties(element, options); + } + } + return UnknownDataReplicationFabricCustomProperties.DeserializeUnknownDataReplicationFabricCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs new file mode 100644 index 000000000000..f948ab6a88c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 DataReplicationFabricCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationFabricCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationFabricCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs new file mode 100644 index 000000000000..efe61f3df119 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + 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, options); + } + } + + DataReplicationFabricPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricPatch(document.RootElement, options); + } + + internal static DataReplicationFabricPatch DeserializeDataReplicationFabricPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DataReplicationFabricProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricProperties.DeserializeDataReplicationFabricProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs new file mode 100644 index 000000000000..c5a4dd1bb692 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric model update. + public partial class DataReplicationFabricPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationFabricPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, DataReplicationFabricProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Fabric model properties. + public DataReplicationFabricProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs new file mode 100644 index 000000000000..7357a93dc1f8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceEndpoint)) + { + writer.WritePropertyName("serviceEndpoint"u8); + writer.WriteStringValue(ServiceEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricProperties(document.RootElement, options); + } + + internal static DataReplicationFabricProperties DeserializeDataReplicationFabricProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + string serviceEndpoint = default; + ResourceIdentifier serviceResourceId = default; + DataReplicationHealthStatus? health = default; + IReadOnlyList healthErrors = default; + DataReplicationFabricCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceEndpoint"u8)) + { + serviceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new DataReplicationHealthStatus(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(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationFabricCustomProperties.DeserializeDataReplicationFabricCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs new file mode 100644 index 000000000000..316e0a251f95 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs @@ -0,0 +1,109 @@ +// 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 DataReplicationFabricProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// 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 DataReplicationFabricProperties(DataReplicationFabricCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricProperties(DataReplicationProvisioningState? provisioningState, string serviceEndpoint, ResourceIdentifier serviceResourceId, DataReplicationHealthStatus? health, IReadOnlyList healthErrors, DataReplicationFabricCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceEndpoint = serviceEndpoint; + ServiceResourceId = serviceResourceId; + Health = health; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricProperties() + { + } + + /// Gets or sets the provisioning state of the fabric. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the service endpoint. + public string ServiceEndpoint { get; } + /// Gets or sets the service resource Id. + public ResourceIdentifier ServiceResourceId { get; } + /// Gets or sets the fabric health. + public DataReplicationHealthStatus? 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 DataReplicationFabricCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs new file mode 100644 index 000000000000..a26bb5f95c7f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationHealthErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AffectedResourceType)) + { + writer.WritePropertyName("affectedResourceType"u8); + writer.WriteStringValue(AffectedResourceType.Value); + } + if (Optional.IsCollectionDefined(AffectedResourceCorrelationIds)) + { + writer.WritePropertyName("affectedResourceCorrelationIds"u8); + writer.WriteStartArray(); + foreach (var item in AffectedResourceCorrelationIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ChildErrors)) + { + writer.WritePropertyName("childErrors"u8); + writer.WriteStartArray(); + foreach (var item in ChildErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationHealthErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationHealthErrorInfo(document.RootElement, options); + } + + internal static DataReplicationHealthErrorInfo DeserializeDataReplicationHealthErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType? affectedResourceType = default; + IReadOnlyList affectedResourceCorrelationIds = default; + IReadOnlyList childErrors = default; + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affectedResourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedResourceType = new ResourceType(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(DataReplicationInnerHealthErrorInfo.DeserializeDataReplicationInnerHealthErrorInfo(item, options)); + } + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationHealthErrorInfo( + affectedResourceType, + affectedResourceCorrelationIds ?? new ChangeTrackingList(), + childErrors ?? new ChangeTrackingList(), + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationHealthErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationHealthErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs new file mode 100644 index 000000000000..6105c45194d0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs @@ -0,0 +1,120 @@ +// 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 DataReplicationHealthErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationHealthErrorInfo() + { + AffectedResourceCorrelationIds = new ChangeTrackingList(); + ChildErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal DataReplicationHealthErrorInfo(ResourceType? 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, IDictionary serializedAdditionalRawData) + { + 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; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the type of affected resource type. + public ResourceType? 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/DataReplicationHealthStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs new file mode 100644 index 000000000000..716a87911b30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.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 DataReplicationHealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationHealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NormalValue = "Normal"; + private const string WarningValue = "Warning"; + private const string CriticalValue = "Critical"; + + /// Healthy Status. + public static DataReplicationHealthStatus Normal { get; } = new DataReplicationHealthStatus(NormalValue); + /// Warning Status. + public static DataReplicationHealthStatus Warning { get; } = new DataReplicationHealthStatus(WarningValue); + /// Critical Status. + public static DataReplicationHealthStatus Critical { get; } = new DataReplicationHealthStatus(CriticalValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationHealthStatus left, DataReplicationHealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationHealthStatus left, DataReplicationHealthStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationHealthStatus(string value) => new DataReplicationHealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationHealthStatus other && Equals(other); + /// + public bool Equals(DataReplicationHealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs new file mode 100644 index 000000000000..d8d0d9b51719 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support writing '{format}' format."); + } + + 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); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationIdentity(document.RootElement, options); + } + + internal static DataReplicationIdentity DeserializeDataReplicationIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid tenantId = default; + string applicationId = default; + string objectId = default; + string audience = default; + string aadAuthority = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationIdentity( + tenantId, + applicationId, + objectId, + audience, + aadAuthority, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs new file mode 100644 index 000000000000..0b1a73510c21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Identity model. + public partial class DataReplicationIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// , , or is null. + public DataReplicationIdentity(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; + } + + /// Initializes a new instance of . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// Keeps track of any properties unknown to the library. + internal DataReplicationIdentity(Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority, IDictionary serializedAdditionalRawData) + { + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationIdentity() + { + } + + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + public Guid TenantId { get; set; } + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + public string ApplicationId { get; set; } + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + public string ObjectId { get; set; } + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + public string Audience { get; set; } + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + public string AadAuthority { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs new file mode 100644 index 000000000000..95db49b6643a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationInnerHealthErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationInnerHealthErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationInnerHealthErrorInfo(document.RootElement, options); + } + + internal static DataReplicationInnerHealthErrorInfo DeserializeDataReplicationInnerHealthErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationInnerHealthErrorInfo( + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationInnerHealthErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationInnerHealthErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs new file mode 100644 index 000000000000..2d9fcba3dcf6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Inner health error model. + public partial class DataReplicationInnerHealthErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationInnerHealthErrorInfo() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal DataReplicationInnerHealthErrorInfo(string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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/DataReplicationJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..695de78f6e69 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationJobCustomProperties))] + public partial class DataReplicationJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && Optional.IsDefined(AffectedObjectDetails)) + { + writer.WritePropertyName("affectedObjectDetails"u8); + writer.WriteObjectValue(AffectedObjectDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + + internal static DataReplicationJobCustomProperties DeserializeDataReplicationJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FailoverJobDetails": return FailoverJobCustomProperties.DeserializeFailoverJobCustomProperties(element, options); + case "TestFailoverCleanupJobDetails": return TestFailoverCleanupJobCustomProperties.DeserializeTestFailoverCleanupJobCustomProperties(element, options); + case "TestFailoverJobDetails": return TestFailoverJobCustomProperties.DeserializeTestFailoverJobCustomProperties(element, options); + } + } + return UnknownDataReplicationJobCustomProperties.DeserializeUnknownDataReplicationJobCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs new file mode 100644 index 000000000000..1547285af3ef --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Job 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 DataReplicationJobCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationJobCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + AffectedObjectDetails = affectedObjectDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationJobCustomProperties. + internal string InstanceType { get; set; } + /// Gets or sets any custom properties of the affected object. + public JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs new file mode 100644 index 000000000000..9d728afd64f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.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 DataReplicationJobObjectType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationJobObjectType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvsDiskPoolValue = "AvsDiskPool"; + private const string FabricAgentValue = "FabricAgent"; + 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"; + + /// AVS disk pool. + public static DataReplicationJobObjectType AvsDiskPool { get; } = new DataReplicationJobObjectType(AvsDiskPoolValue); + /// Fabric agent level workflow. + public static DataReplicationJobObjectType FabricAgent { get; } = new DataReplicationJobObjectType(FabricAgentValue); + /// Fabric level job. + public static DataReplicationJobObjectType Fabric { get; } = new DataReplicationJobObjectType(FabricValue); + /// Policy level job. + public static DataReplicationJobObjectType Policy { get; } = new DataReplicationJobObjectType(PolicyValue); + /// Protected item level job. + public static DataReplicationJobObjectType ProtectedItem { get; } = new DataReplicationJobObjectType(ProtectedItemValue); + /// Recovery plan level job. + public static DataReplicationJobObjectType RecoveryPlan { get; } = new DataReplicationJobObjectType(RecoveryPlanValue); + /// Replication extension level job. + public static DataReplicationJobObjectType ReplicationExtension { get; } = new DataReplicationJobObjectType(ReplicationExtensionValue); + /// Vault level job. + public static DataReplicationJobObjectType Vault { get; } = new DataReplicationJobObjectType(VaultValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationJobObjectType left, DataReplicationJobObjectType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationJobObjectType left, DataReplicationJobObjectType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationJobObjectType(string value) => new DataReplicationJobObjectType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationJobObjectType other && Equals(other); + /// + public bool Equals(DataReplicationJobObjectType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs new file mode 100644 index 000000000000..e37168057c76 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectName)) + { + writer.WritePropertyName("objectName"u8); + writer.WriteStringValue(ObjectName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalId)) + { + writer.WritePropertyName("objectInternalId"u8); + writer.WriteStringValue(ObjectInternalId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalName)) + { + writer.WritePropertyName("objectInternalName"u8); + writer.WriteStringValue(ObjectInternalName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectType)) + { + writer.WritePropertyName("objectType"u8); + writer.WriteStringValue(ObjectType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationProviderId)) + { + writer.WritePropertyName("replicationProviderId"u8); + writer.WriteStringValue(ReplicationProviderId); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedActions)) + { + writer.WritePropertyName("allowedActions"u8); + writer.WriteStartArray(); + foreach (var item in AllowedActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ActivityId)) + { + writer.WritePropertyName("activityId"u8); + writer.WriteStringValue(ActivityId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Tasks)) + { + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobProperties(document.RootElement, options); + } + + internal static DataReplicationJobProperties DeserializeDataReplicationJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string displayName = default; + DataReplicationJobState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + string objectId = default; + string objectName = default; + string objectInternalId = default; + string objectInternalName = default; + DataReplicationJobObjectType? objectType = default; + string replicationProviderId = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + IReadOnlyList allowedActions = default; + string activityId = default; + IReadOnlyList tasks = default; + IReadOnlyList errors = default; + DataReplicationJobCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 DataReplicationJobState(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 DataReplicationJobObjectType(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(DataReplicationTask.DeserializeDataReplicationTask(item, options)); + } + 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(DataReplicationErrorInfo.DeserializeDataReplicationErrorInfo(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationJobCustomProperties.DeserializeDataReplicationJobCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationJobProperties( + displayName, + state, + startTime, + endTime, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions ?? new ChangeTrackingList(), + activityId, + tasks ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs new file mode 100644 index 000000000000..7f89805eccbb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Job model properties. + public partial class DataReplicationJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Job 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 DataReplicationJobProperties(DataReplicationJobCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + AllowedActions = new ChangeTrackingList(); + Tasks = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job 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 job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job 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 . + /// + /// Gets or sets the provisioning state of the job. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobProperties(string displayName, DataReplicationJobState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, string objectId, string objectName, string objectInternalId, string objectInternalName, DataReplicationJobObjectType? objectType, string replicationProviderId, string sourceFabricProviderId, string targetFabricProviderId, IReadOnlyList allowedActions, string activityId, IReadOnlyList tasks, IReadOnlyList errors, DataReplicationJobCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + 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; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationJobProperties() + { + } + + /// Gets or sets the friendly display name. + public string DisplayName { get; } + /// Gets or sets the job state. + public DataReplicationJobState? 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 DataReplicationJobObjectType? 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 job. + public IReadOnlyList AllowedActions { get; } + /// Gets or sets the job 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; } + /// + /// Job 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 DataReplicationJobCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the job. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs new file mode 100644 index 000000000000..12b9e9111f4a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.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 job state. + public readonly partial struct DataReplicationJobState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationJobState(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"; + + /// Job has not been started. + public static DataReplicationJobState Pending { get; } = new DataReplicationJobState(PendingValue); + /// Job is in progress. + public static DataReplicationJobState Started { get; } = new DataReplicationJobState(StartedValue); + /// Job cancellation is in progress. + public static DataReplicationJobState Cancelling { get; } = new DataReplicationJobState(CancellingValue); + /// Job has completed successfully. + public static DataReplicationJobState Succeeded { get; } = new DataReplicationJobState(SucceededValue); + /// Job failed. + public static DataReplicationJobState Failed { get; } = new DataReplicationJobState(FailedValue); + /// Job has been cancelled. + public static DataReplicationJobState Cancelled { get; } = new DataReplicationJobState(CancelledValue); + /// Job has completed with information. + public static DataReplicationJobState CompletedWithInformation { get; } = new DataReplicationJobState(CompletedWithInformationValue); + /// Job has completed with warnings. + public static DataReplicationJobState CompletedWithWarnings { get; } = new DataReplicationJobState(CompletedWithWarningsValue); + /// Job has completed with errors. + public static DataReplicationJobState CompletedWithErrors { get; } = new DataReplicationJobState(CompletedWithErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationJobState left, DataReplicationJobState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationJobState left, DataReplicationJobState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationJobState(string value) => new DataReplicationJobState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationJobState other && Equals(other); + /// + public bool Equals(DataReplicationJobState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs new file mode 100644 index 000000000000..2208a1904a17 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationNameAvailabilityContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationNameAvailabilityContent(document.RootElement, options); + } + + internal static DataReplicationNameAvailabilityContent DeserializeDataReplicationNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ResourceType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationNameAvailabilityContent(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationNameAvailabilityContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs new file mode 100644 index 000000000000..987f7b7ff78e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.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 +{ + /// Check name availability model. + public partial class DataReplicationNameAvailabilityContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationNameAvailabilityContent() + { + } + + /// Initializes a new instance of . + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Keeps track of any properties unknown to the library. + internal DataReplicationNameAvailabilityContent(string name, ResourceType? type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public ResourceType? Type { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs new file mode 100644 index 000000000000..b747c45b545f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsNameAvailable)) + { + writer.WritePropertyName("nameAvailable"u8); + writer.WriteBooleanValue(IsNameAvailable.Value); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationNameAvailabilityResult(document.RootElement, options); + } + + internal static DataReplicationNameAvailabilityResult DeserializeDataReplicationNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? nameAvailable = default; + string reason = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationNameAvailabilityResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs new file mode 100644 index 000000000000..450333f70f82 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Check name availability response model. + public partial class DataReplicationNameAvailabilityResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationNameAvailabilityResult() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal DataReplicationNameAvailabilityResult(bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + { + IsNameAvailable = isNameAvailable; + Reason = reason; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets a value indicating whether resource name is available or not. + public bool? IsNameAvailable { 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/DataReplicationPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d02fde43db35 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationPolicyCustomProperties))] + public partial class DataReplicationPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + + internal static DataReplicationPolicyCustomProperties DeserializeDataReplicationPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciPolicyCustomProperties.DeserializeHyperVToAzStackHciPolicyCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciPolicyCustomProperties.DeserializeVMwareToAzStackHciPolicyCustomProperties(element, options); + } + } + return UnknownDataReplicationPolicyCustomProperties.DeserializeUnknownDataReplicationPolicyCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs new file mode 100644 index 000000000000..92a683cd1240 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 DataReplicationPolicyCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationPolicyCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationPolicyCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs new file mode 100644 index 000000000000..698b50e7fac1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyProperties(document.RootElement, options); + } + + internal static DataReplicationPolicyProperties DeserializeDataReplicationPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + DataReplicationPolicyCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationPolicyCustomProperties.DeserializeDataReplicationPolicyCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPolicyProperties(provisioningState, customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs new file mode 100644 index 000000000000..8ae3477e3627 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Policy model properties. + public partial class DataReplicationPolicyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// 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 DataReplicationPolicyProperties(DataReplicationPolicyCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyProperties(DataReplicationProvisioningState? provisioningState, DataReplicationPolicyCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationPolicyProperties() + { + } + + /// Gets or sets the provisioning state of the policy. + public DataReplicationProvisioningState? 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 DataReplicationPolicyCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..c4b39a621940 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateEndpointConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProperties DeserializeDataReplicationPrivateEndpointConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + WritableSubResource privateEndpoint = default; + DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = DataReplicationPrivateLinkServiceConnectionState.DeserializeDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProperties(provisioningState, privateEndpoint, privateLinkServiceConnectionState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..23a3d03b5407 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs @@ -0,0 +1,87 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private endpoint connection response properties. + public partial class DataReplicationPrivateEndpointConnectionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProperties(DataReplicationProvisioningState? provisioningState, WritableSubResource privateEndpoint, DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets provisioning state of the private endpoint connection. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + internal WritableSubResource PrivateEndpoint { get; set; } + /// Gets or sets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + set + { + if (PrivateEndpoint is null) + PrivateEndpoint = new WritableSubResource(); + PrivateEndpoint.Id = value; + } + } + + /// Represents Private link service connection state. + public DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs new file mode 100644 index 000000000000..0ef486c4a75b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(RemotePrivateEndpoint)) + { + writer.WritePropertyName("remotePrivateEndpoint"u8); + writer.WriteObjectValue(RemotePrivateEndpoint, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateEndpointConnectionProxyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProxyProperties DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + RemotePrivateEndpoint remotePrivateEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("remotePrivateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpoint = RemotePrivateEndpoint.DeserializeRemotePrivateEndpoint(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProxyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs new file mode 100644 index 000000000000..4eb79b1144da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private endpoint connection proxy request. + public partial class DataReplicationPrivateEndpointConnectionProxyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProxyProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProxyProperties(DataReplicationProvisioningState? provisioningState, RemotePrivateEndpoint remotePrivateEndpoint, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + RemotePrivateEndpoint = remotePrivateEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the private endpoint connection proxy. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Represent remote private endpoint information for the private endpoint connection proxy. + public RemotePrivateEndpoint RemotePrivateEndpoint { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..358797b4baae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.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 status. + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationPrivateEndpointConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApprovedValue = "Approved"; + private const string DisconnectedValue = "Disconnected"; + private const string PendingValue = "Pending"; + private const string RejectedValue = "Rejected"; + + /// Approved Status. + public static DataReplicationPrivateEndpointConnectionStatus Approved { get; } = new DataReplicationPrivateEndpointConnectionStatus(ApprovedValue); + /// Disconnected Status. + public static DataReplicationPrivateEndpointConnectionStatus Disconnected { get; } = new DataReplicationPrivateEndpointConnectionStatus(DisconnectedValue); + /// Pending Status. + public static DataReplicationPrivateEndpointConnectionStatus Pending { get; } = new DataReplicationPrivateEndpointConnectionStatus(PendingValue); + /// Rejected Status. + public static DataReplicationPrivateEndpointConnectionStatus Rejected { get; } = new DataReplicationPrivateEndpointConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationPrivateEndpointConnectionStatus left, DataReplicationPrivateEndpointConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationPrivateEndpointConnectionStatus left, DataReplicationPrivateEndpointConnectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationPrivateEndpointConnectionStatus(string value) => new DataReplicationPrivateEndpointConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationPrivateEndpointConnectionStatus other && Equals(other); + /// + public bool Equals(DataReplicationPrivateEndpointConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..3904a61e6821 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsCollectionDefined(RequiredMembers)) + { + writer.WritePropertyName("requiredMembers"u8); + writer.WriteStartArray(); + foreach (var item in RequiredMembers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkResourceProperties DeserializeDataReplicationPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + IReadOnlyList requiredMembers = default; + IReadOnlyList requiredZoneNames = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredMembers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property.NameEquals("requiredZoneNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..6c9efbbf97ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private link resource properties. + public partial class DataReplicationPrivateLinkResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationPrivateLinkResourceProperties() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the group id. + public string GroupId { get; } + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + public IReadOnlyList RequiredMembers { get; } + /// Gets or sets the private DNS zone names. + public IReadOnlyList RequiredZoneNames { get; } + /// Gets or sets the provisioning state of the private link resource. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs new file mode 100644 index 000000000000..b1dd443b9ea2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceConnection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RequestMessage)) + { + writer.WritePropertyName("requestMessage"u8); + writer.WriteStringValue(RequestMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceConnection(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceConnection DeserializeDataReplicationPrivateLinkServiceConnection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList groupIds = default; + string requestMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property.NameEquals("requestMessage"u8)) + { + requestMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceConnection(name, groupIds ?? new ChangeTrackingList(), requestMessage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceConnection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs new file mode 100644 index 000000000000..060643fc168e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of an NRP private link service connection. + public partial class DataReplicationPrivateLinkServiceConnection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceConnection() + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service connection name. + /// Gets or sets group ids. + /// Gets or sets the request message for the private link service connection. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceConnection(string name, IList groupIds, string requestMessage, IDictionary serializedAdditionalRawData) + { + Name = name; + GroupIds = groupIds; + RequestMessage = requestMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service connection name. + public string Name { get; set; } + /// Gets or sets group ids. + public IList GroupIds { get; } + /// Gets or sets the request message for the private link service connection. + public string RequestMessage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..045634d1a8eb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceConnectionState DeserializeDataReplicationPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionStatus? status = default; + string description = default; + string actionsRequired = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new DataReplicationPrivateEndpointConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..f8512e72711d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private link service connection state. + public partial class DataReplicationPrivateLinkServiceConnectionState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of . + /// Gets or sets the status. + /// Gets or sets description. + /// Gets or sets actions required. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceConnectionState(DataReplicationPrivateEndpointConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the status. + public DataReplicationPrivateEndpointConnectionStatus? Status { get; set; } + /// Gets or sets description. + public string Description { get; set; } + /// Gets or sets actions required. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs new file mode 100644 index 000000000000..2147ad16318e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceProxy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(RemotePrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("remotePrivateLinkServiceConnectionState"u8); + writer.WriteObjectValue(RemotePrivateLinkServiceConnectionState, options); + } + if (Optional.IsDefined(RemotePrivateEndpointConnection)) + { + writer.WritePropertyName("remotePrivateEndpointConnection"u8); + JsonSerializer.Serialize(writer, RemotePrivateEndpointConnection); + } + if (Optional.IsCollectionDefined(GroupConnectivityInformation)) + { + writer.WritePropertyName("groupConnectivityInformation"u8); + writer.WriteStartArray(); + foreach (var item in GroupConnectivityInformation) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceProxy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceProxy(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceProxy DeserializeDataReplicationPrivateLinkServiceProxy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState = default; + WritableSubResource remotePrivateEndpointConnection = default; + IList groupConnectivityInformation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("remotePrivateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateLinkServiceConnectionState = DataReplicationPrivateLinkServiceConnectionState.DeserializeDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (property.NameEquals("remotePrivateEndpointConnection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpointConnection = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("groupConnectivityInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.GroupConnectivityInformation.DeserializeGroupConnectivityInformation(item, options)); + } + groupConnectivityInformation = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceProxy(id, remotePrivateLinkServiceConnectionState, remotePrivateEndpointConnection, groupConnectivityInformation ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceProxy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceProxy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs new file mode 100644 index 000000000000..4acfbd31398d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs @@ -0,0 +1,92 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents NRP private link service proxy. + public partial class DataReplicationPrivateLinkServiceProxy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceProxy() + { + GroupConnectivityInformation = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Represents Private link service connection state. + /// Represent remote private endpoint connection. + /// Gets or sets group connectivity information. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceProxy(string id, DataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState, WritableSubResource remotePrivateEndpointConnection, IList groupConnectivityInformation, IDictionary serializedAdditionalRawData) + { + Id = id; + RemotePrivateLinkServiceConnectionState = remotePrivateLinkServiceConnectionState; + RemotePrivateEndpointConnection = remotePrivateEndpointConnection; + GroupConnectivityInformation = groupConnectivityInformation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Represents Private link service connection state. + public DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get; set; } + /// Represent remote private endpoint connection. + internal WritableSubResource RemotePrivateEndpointConnection { get; set; } + /// Gets or sets Id. + public ResourceIdentifier RemotePrivateEndpointConnectionId + { + get => RemotePrivateEndpointConnection is null ? default : RemotePrivateEndpointConnection.Id; + set + { + if (RemotePrivateEndpointConnection is null) + RemotePrivateEndpointConnection = new WritableSubResource(); + RemotePrivateEndpointConnection.Id = value; + } + } + + /// Gets or sets group connectivity information. + public IList GroupConnectivityInformation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..b87f4cfec4d7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationProtectedItemCustomProperties))] + public partial class DataReplicationProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + + internal static DataReplicationProtectedItemCustomProperties DeserializeDataReplicationProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciProtectedItemCustomProperties.DeserializeHyperVToAzStackHciProtectedItemCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciProtectedItemCustomProperties.DeserializeVMwareToAzStackHciProtectedItemCustomProperties(element, options); + } + } + return UnknownDataReplicationProtectedItemCustomProperties.DeserializeUnknownDataReplicationProtectedItemCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..6e873ed41dc0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 DataReplicationProtectedItemCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationProtectedItemCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..140331ed07a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationProtectedItemCustomPropertiesUpdate))] + public partial class DataReplicationProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static DataReplicationProtectedItemCustomPropertiesUpdate DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(element, options); + } + } + return UnknownDataReplicationProtectedItemCustomPropertiesUpdate.DeserializeUnknownDataReplicationProtectedItemCustomPropertiesUpdate(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..fad7b9e3c898 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 DataReplicationProtectedItemCustomPropertiesUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationProtectedItemCustomPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs new file mode 100644 index 000000000000..ca931f034a4a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationProtectedItemPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationProtectedItemPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemPatch(document.RootElement, options); + } + + internal static DataReplicationProtectedItemPatch DeserializeDataReplicationProtectedItemPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemPropertiesUpdate properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationProtectedItemPropertiesUpdate.DeserializeDataReplicationProtectedItemPropertiesUpdate(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemPatch( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs new file mode 100644 index 000000000000..c7362444ef90 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.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; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model update. + public partial class DataReplicationProtectedItemPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemPatch() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationProtectedItemPropertiesUpdate properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Protected item model properties. + internal DataReplicationProtectedItemPropertiesUpdate Properties { get; set; } + /// + /// Protected item model custom properties update. + /// 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 DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set + { + if (Properties is null) + Properties = new DataReplicationProtectedItemPropertiesUpdate(); + Properties.CustomProperties = value; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs new file mode 100644 index 000000000000..252063569b41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationProtectedItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("policyName"u8); + writer.WriteStringValue(PolicyName); + writer.WritePropertyName("replicationExtensionName"u8); + writer.WriteStringValue(ReplicationExtensionName); + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionState)) + { + writer.WritePropertyName("protectionState"u8); + writer.WriteStringValue(ProtectionState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionStateDescription)) + { + writer.WritePropertyName("protectionStateDescription"u8); + writer.WriteStringValue(ProtectionStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverState)) + { + writer.WritePropertyName("testFailoverState"u8); + writer.WriteStringValue(TestFailoverState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverStateDescription)) + { + writer.WritePropertyName("testFailoverStateDescription"u8); + writer.WriteStringValue(TestFailoverStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(ResynchronizationState)) + { + writer.WritePropertyName("resynchronizationState"u8); + writer.WriteStringValue(ResynchronizationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectId)) + { + writer.WritePropertyName("fabricObjectId"u8); + writer.WriteStringValue(FabricObjectId); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectName)) + { + writer.WritePropertyName("fabricObjectName"u8); + writer.WriteStringValue(FabricObjectName); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(FabricId)) + { + writer.WritePropertyName("fabricId"u8); + writer.WriteStringValue(FabricId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricId)) + { + writer.WritePropertyName("targetFabricId"u8); + writer.WriteStringValue(TargetFabricId); + } + if (options.Format != "W" && Optional.IsDefined(FabricAgentId)) + { + writer.WritePropertyName("fabricAgentId"u8); + writer.WriteStringValue(FabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricAgentId)) + { + writer.WritePropertyName("targetFabricAgentId"u8); + writer.WriteStringValue(TargetFabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(IsResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(IsResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulPlannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulPlannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulPlannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulUnplannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulUnplannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulUnplannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulTestFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulTestFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulTestFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CurrentJob)) + { + writer.WritePropertyName("currentJob"u8); + writer.WriteObjectValue(CurrentJob, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedJobs)) + { + writer.WritePropertyName("allowedJobs"u8); + writer.WriteStartArray(); + foreach (var item in AllowedJobs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedEnableProtectionJob)) + { + writer.WritePropertyName("lastFailedEnableProtectionJob"u8); + writer.WriteObjectValue(LastFailedEnableProtectionJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedPlannedFailoverJob)) + { + writer.WritePropertyName("lastFailedPlannedFailoverJob"u8); + writer.WriteObjectValue(LastFailedPlannedFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastTestFailoverJob)) + { + writer.WritePropertyName("lastTestFailoverJob"u8); + writer.WriteObjectValue(LastTestFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationHealth)) + { + writer.WritePropertyName("replicationHealth"u8); + writer.WriteStringValue(ReplicationHealth.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemProperties(document.RootElement, options); + } + + internal static DataReplicationProtectedItemProperties DeserializeDataReplicationProtectedItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string policyName = default; + string replicationExtensionName = default; + string correlationId = default; + DataReplicationProvisioningState? provisioningState = default; + DataReplicationProtectionState? protectionState = default; + string protectionStateDescription = default; + DataReplicationTestFailoverState? testFailoverState = default; + string testFailoverStateDescription = default; + DataReplicationResynchronizationState? resynchronizationState = default; + string fabricObjectId = default; + string fabricObjectName = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + string fabricId = default; + string targetFabricId = default; + string fabricAgentId = default; + string targetFabricAgentId = default; + bool? resyncRequired = default; + DateTimeOffset? lastSuccessfulPlannedFailoverTime = default; + DateTimeOffset? lastSuccessfulUnplannedFailoverTime = default; + DateTimeOffset? lastSuccessfulTestFailoverTime = default; + ProtectedItemJobProperties currentJob = default; + IReadOnlyList allowedJobs = default; + ProtectedItemJobProperties lastFailedEnableProtectionJob = default; + ProtectedItemJobProperties lastFailedPlannedFailoverJob = default; + ProtectedItemJobProperties lastTestFailoverJob = default; + DataReplicationHealthStatus? replicationHealth = default; + IReadOnlyList healthErrors = default; + DataReplicationProtectedItemCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectionState = new DataReplicationProtectionState(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 DataReplicationTestFailoverState(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 DataReplicationResynchronizationState(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("fabricAgentId"u8)) + { + fabricAgentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentId"u8)) + { + targetFabricAgentId = 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 = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + 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 = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastFailedPlannedFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedPlannedFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastTestFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTestFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicationHealth = new DataReplicationHealthStatus(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(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationProtectedItemCustomProperties.DeserializeDataReplicationProtectedItemCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + resyncRequired, + lastSuccessfulPlannedFailoverTime, + lastSuccessfulUnplannedFailoverTime, + lastSuccessfulTestFailoverTime, + currentJob, + allowedJobs ?? new ChangeTrackingList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs new file mode 100644 index 000000000000..552a140003f6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties. + public partial class DataReplicationProtectedItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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 DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, DataReplicationProtectedItemCustomProperties 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 . + /// 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 fabric agent. + /// 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 fabric agent Id. + /// Gets or sets the target fabric agent 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 current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, string correlationId, DataReplicationProvisioningState? provisioningState, DataReplicationProtectionState? protectionState, string protectionStateDescription, DataReplicationTestFailoverState? testFailoverState, string testFailoverStateDescription, DataReplicationResynchronizationState? resynchronizationState, string fabricObjectId, string fabricObjectName, string sourceFabricProviderId, string targetFabricProviderId, string fabricId, string targetFabricId, string fabricAgentId, string targetFabricAgentId, bool? isResyncRequired, DateTimeOffset? lastSuccessfulPlannedFailoverOn, DateTimeOffset? lastSuccessfulUnplannedFailoverOn, DateTimeOffset? lastSuccessfulTestFailoverOn, ProtectedItemJobProperties currentJob, IReadOnlyList allowedJobs, ProtectedItemJobProperties lastFailedEnableProtectionJob, ProtectedItemJobProperties lastFailedPlannedFailoverJob, ProtectedItemJobProperties lastTestFailoverJob, DataReplicationHealthStatus? replicationHealth, IReadOnlyList healthErrors, DataReplicationProtectedItemCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + 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; + FabricAgentId = fabricAgentId; + TargetFabricAgentId = targetFabricAgentId; + IsResyncRequired = isResyncRequired; + LastSuccessfulPlannedFailoverOn = lastSuccessfulPlannedFailoverOn; + LastSuccessfulUnplannedFailoverOn = lastSuccessfulUnplannedFailoverOn; + LastSuccessfulTestFailoverOn = lastSuccessfulTestFailoverOn; + CurrentJob = currentJob; + AllowedJobs = allowedJobs; + LastFailedEnableProtectionJob = lastFailedEnableProtectionJob; + LastFailedPlannedFailoverJob = lastFailedPlannedFailoverJob; + LastTestFailoverJob = lastTestFailoverJob; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationProtectedItemProperties() + { + } + + /// 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 fabric agent. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the protection state. + public DataReplicationProtectionState? ProtectionState { get; } + /// Gets or sets the protection state description. + public string ProtectionStateDescription { get; } + /// Gets or sets the test failover state. + public DataReplicationTestFailoverState? TestFailoverState { get; } + /// Gets or sets the Test failover state description. + public string TestFailoverStateDescription { get; } + /// Gets or sets the resynchronization state. + public DataReplicationResynchronizationState? 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 fabric agent Id. + public string FabricAgentId { get; } + /// Gets or sets the target fabric agent Id. + public string TargetFabricAgentId { get; } + /// Gets or sets a value indicating whether resynchronization is required or not. + public bool? IsResyncRequired { 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 or sets the current scenario. + public ProtectedItemJobProperties CurrentJob { get; } + /// Gets or sets the allowed scenarios on the protected item. + public IReadOnlyList AllowedJobs { get; } + /// Gets or sets the last failed enabled protection job. + public ProtectedItemJobProperties LastFailedEnableProtectionJob { get; } + /// Gets or sets the last failed planned failover job. + public ProtectedItemJobProperties LastFailedPlannedFailoverJob { get; } + /// Gets or sets the last test failover job. + public ProtectedItemJobProperties LastTestFailoverJob { get; } + /// Gets or sets protected item replication health. + public DataReplicationHealthStatus? 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 DataReplicationProtectedItemCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..e9db8067dff5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class DataReplicationProtectedItemPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemPropertiesUpdate(document.RootElement, options); + } + + internal static DataReplicationProtectedItemPropertiesUpdate DeserializeDataReplicationProtectedItemPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemCustomPropertiesUpdate customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = DataReplicationProtectedItemCustomPropertiesUpdate.DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemPropertiesUpdate(customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs new file mode 100644 index 000000000000..f46e3bb1980e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties update. + internal partial class DataReplicationProtectedItemPropertiesUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// + /// Protected item model custom properties update. + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemPropertiesUpdate(DataReplicationProtectedItemCustomPropertiesUpdate customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Protected item model custom properties update. + /// 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 DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs new file mode 100644 index 000000000000..2d32abae86c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.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 DataReplicationProtectionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationProtectionState(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"; + + /// Begin marker for unprotected states. + public static DataReplicationProtectionState UnprotectedStatesBegin { get; } = new DataReplicationProtectionState(UnprotectedStatesBeginValue); + /// Enable protection is in progress. + public static DataReplicationProtectionState EnablingProtection { get; } = new DataReplicationProtectionState(EnablingProtectionValue); + /// Enable protection failed. + public static DataReplicationProtectionState EnablingFailed { get; } = new DataReplicationProtectionState(EnablingFailedValue); + /// Disabling protection is in progress. + public static DataReplicationProtectionState DisablingProtection { get; } = new DataReplicationProtectionState(DisablingProtectionValue); + /// Disabling protection succeeded. This is a transient state before the protected item is deleted. + public static DataReplicationProtectionState MarkedForDeletion { get; } = new DataReplicationProtectionState(MarkedForDeletionValue); + /// Disable protection failed. + public static DataReplicationProtectionState DisablingFailed { get; } = new DataReplicationProtectionState(DisablingFailedValue); + /// End marker for unprotected states. + public static DataReplicationProtectionState UnprotectedStatesEnd { get; } = new DataReplicationProtectionState(UnprotectedStatesEndValue); + /// Begin marker for initial replication states. + public static DataReplicationProtectionState InitialReplicationStatesBegin { get; } = new DataReplicationProtectionState(InitialReplicationStatesBeginValue); + /// Initial replication is in progress. + public static DataReplicationProtectionState InitialReplicationInProgress { get; } = new DataReplicationProtectionState(InitialReplicationInProgressValue); + /// Initial replication has completed on the primary side. + public static DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get; } = new DataReplicationProtectionState(InitialReplicationCompletedOnPrimaryValue); + /// Initial replication has completed on the recovery side. + public static DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get; } = new DataReplicationProtectionState(InitialReplicationCompletedOnRecoveryValue); + /// Initial replication failed and would need to be started again. + public static DataReplicationProtectionState InitialReplicationFailed { get; } = new DataReplicationProtectionState(InitialReplicationFailedValue); + /// End marker for initial replication states. + public static DataReplicationProtectionState InitialReplicationStatesEnd { get; } = new DataReplicationProtectionState(InitialReplicationStatesEndValue); + /// Begin marker for protected steady-state states. + public static DataReplicationProtectionState ProtectedStatesBegin { get; } = new DataReplicationProtectionState(ProtectedStatesBeginValue); + /// Protected item is protected and replication is on-going. Any issues with replication will be surfaced separately via the health property and will not affect the state. + public static DataReplicationProtectionState Protected { get; } = new DataReplicationProtectionState(ProtectedValue); + /// End marker for protected steady-state states. + public static DataReplicationProtectionState ProtectedStatesEnd { get; } = new DataReplicationProtectionState(ProtectedStatesEndValue); + /// Begin marker for planned failover transition states. + public static DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get; } = new DataReplicationProtectionState(PlannedFailoverTransitionStatesBeginValue); + /// Planned failover has been initiated. + public static DataReplicationProtectionState PlannedFailoverInitiated { get; } = new DataReplicationProtectionState(PlannedFailoverInitiatedValue); + /// Planned failover preparing protected entities is in progress. + public static DataReplicationProtectionState PlannedFailoverCompleting { get; } = new DataReplicationProtectionState(PlannedFailoverCompletingValue); + /// Planned failover has been completed successfully. + public static DataReplicationProtectionState PlannedFailoverCompleted { get; } = new DataReplicationProtectionState(PlannedFailoverCompletedValue); + /// Planned failover initiation failed. + public static DataReplicationProtectionState PlannedFailoverFailed { get; } = new DataReplicationProtectionState(PlannedFailoverFailedValue); + /// Planned failover preparing protected entities failed. + public static DataReplicationProtectionState PlannedFailoverCompletionFailed { get; } = new DataReplicationProtectionState(PlannedFailoverCompletionFailedValue); + /// End marker for planned failover transition states. + public static DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get; } = new DataReplicationProtectionState(PlannedFailoverTransitionStatesEndValue); + /// Begin marker for unplanned failover transition states. + public static DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get; } = new DataReplicationProtectionState(UnplannedFailoverTransitionStatesBeginValue); + /// Unplanned failover has been initiated. + public static DataReplicationProtectionState UnplannedFailoverInitiated { get; } = new DataReplicationProtectionState(UnplannedFailoverInitiatedValue); + /// Unplanned failover preparing protected entities is in progress. + public static DataReplicationProtectionState UnplannedFailoverCompleting { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletingValue); + /// Unplanned failover preparing protected entities is in progress. + public static DataReplicationProtectionState UnplannedFailoverCompleted { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletedValue); + /// Unplanned failover initiation failed. + public static DataReplicationProtectionState UnplannedFailoverFailed { get; } = new DataReplicationProtectionState(UnplannedFailoverFailedValue); + /// Unplanned failover preparing protected entities failed. + public static DataReplicationProtectionState UnplannedFailoverCompletionFailed { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletionFailedValue); + /// End marker for unplanned failover transition states. + public static DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get; } = new DataReplicationProtectionState(UnplannedFailoverTransitionStatesEndValue); + /// Begin marker for commit failover states. + public static DataReplicationProtectionState CommitFailoverStatesBegin { get; } = new DataReplicationProtectionState(CommitFailoverStatesBeginValue); + /// Commit failover is in progress on the primary side. + public static DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get; } = new DataReplicationProtectionState(CommitFailoverInProgressOnPrimaryValue); + /// Commit failover is in progress on the recovery side. + public static DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get; } = new DataReplicationProtectionState(CommitFailoverInProgressOnRecoveryValue); + /// Commit failover has been completed successfully. + public static DataReplicationProtectionState CommitFailoverCompleted { get; } = new DataReplicationProtectionState(CommitFailoverCompletedValue); + /// Commit failover failed on the primary side. + public static DataReplicationProtectionState CommitFailoverFailedOnPrimary { get; } = new DataReplicationProtectionState(CommitFailoverFailedOnPrimaryValue); + /// Commit failover failed on the recovery side. + public static DataReplicationProtectionState CommitFailoverFailedOnRecovery { get; } = new DataReplicationProtectionState(CommitFailoverFailedOnRecoveryValue); + /// End marker for commit failover states. + public static DataReplicationProtectionState CommitFailoverStatesEnd { get; } = new DataReplicationProtectionState(CommitFailoverStatesEndValue); + /// Begin marker for cancel failover states. + public static DataReplicationProtectionState CancelFailoverStatesBegin { get; } = new DataReplicationProtectionState(CancelFailoverStatesBeginValue); + /// Cancel failover is in progress on the primary side. + public static DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get; } = new DataReplicationProtectionState(CancelFailoverInProgressOnPrimaryValue); + /// Cancel failover is in progress on the recovery side. + public static DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get; } = new DataReplicationProtectionState(CancelFailoverInProgressOnRecoveryValue); + /// Cancel failover failed on the primary side. + public static DataReplicationProtectionState CancelFailoverFailedOnPrimary { get; } = new DataReplicationProtectionState(CancelFailoverFailedOnPrimaryValue); + /// Cancel failover failed on the recovery side. + public static DataReplicationProtectionState CancelFailoverFailedOnRecovery { get; } = new DataReplicationProtectionState(CancelFailoverFailedOnRecoveryValue); + /// End marker for cancel failover states. + public static DataReplicationProtectionState CancelFailoverStatesEnd { get; } = new DataReplicationProtectionState(CancelFailoverStatesEndValue); + /// Begin marker for change recovery point states. + public static DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get; } = new DataReplicationProtectionState(ChangeRecoveryPointStatesBeginValue); + /// Change recovery point has been initiated.. + public static DataReplicationProtectionState ChangeRecoveryPointInitiated { get; } = new DataReplicationProtectionState(ChangeRecoveryPointInitiatedValue); + /// Change recovery point has been completed successfully. + public static DataReplicationProtectionState ChangeRecoveryPointCompleted { get; } = new DataReplicationProtectionState(ChangeRecoveryPointCompletedValue); + /// Change recovery point has failed. + public static DataReplicationProtectionState ChangeRecoveryPointFailed { get; } = new DataReplicationProtectionState(ChangeRecoveryPointFailedValue); + /// End marker for change recovery point states. + public static DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get; } = new DataReplicationProtectionState(ChangeRecoveryPointStatesEndValue); + /// Begin marker for reprotect states. + public static DataReplicationProtectionState ReprotectStatesBegin { get; } = new DataReplicationProtectionState(ReprotectStatesBeginValue); + /// Reprotect has been initiated. + public static DataReplicationProtectionState ReprotectInitiated { get; } = new DataReplicationProtectionState(ReprotectInitiatedValue); + /// Reprotect has failed. + public static DataReplicationProtectionState ReprotectFailed { get; } = new DataReplicationProtectionState(ReprotectFailedValue); + /// End marker for reprotect states. + public static DataReplicationProtectionState ReprotectStatesEnd { get; } = new DataReplicationProtectionState(ReprotectStatesEndValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationProtectionState left, DataReplicationProtectionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationProtectionState left, DataReplicationProtectionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationProtectionState(string value) => new DataReplicationProtectionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationProtectionState other && Equals(other); + /// + public bool Equals(DataReplicationProtectionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs new file mode 100644 index 000000000000..4dd9ab51a4b7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.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 email configuration. + public readonly partial struct DataReplicationProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationProvisioningState(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"; + + /// Resource creation has been canceled. + public static DataReplicationProvisioningState Canceled { get; } = new DataReplicationProvisioningState(CanceledValue); + /// Resource is being created. + public static DataReplicationProvisioningState Creating { get; } = new DataReplicationProvisioningState(CreatingValue); + /// Resource is being deleted. + public static DataReplicationProvisioningState Deleting { get; } = new DataReplicationProvisioningState(DeletingValue); + /// Resource has been deleted. + public static DataReplicationProvisioningState Deleted { get; } = new DataReplicationProvisioningState(DeletedValue); + /// Resource creation failed. + public static DataReplicationProvisioningState Failed { get; } = new DataReplicationProvisioningState(FailedValue); + /// Resource creation/update succeeded. + public static DataReplicationProvisioningState Succeeded { get; } = new DataReplicationProvisioningState(SucceededValue); + /// Resource is being updated. + public static DataReplicationProvisioningState Updating { get; } = new DataReplicationProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationProvisioningState left, DataReplicationProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationProvisioningState left, DataReplicationProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationProvisioningState(string value) => new DataReplicationProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationProvisioningState other && Equals(other); + /// + public bool Equals(DataReplicationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c8cee1a28bff --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationRecoveryPointCustomProperties))] + public partial class DataReplicationRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointCustomProperties DeserializeDataReplicationRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciRecoveryPointCustomProperties.DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(element, options); + case "VMwareToAzStackHCIRecoveryPointModelCustomProperties": return VMwareToAzStackHciRecoveryPointCustomProperties.DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(element, options); + } + } + return UnknownDataReplicationRecoveryPointCustomProperties.DeserializeUnknownDataReplicationRecoveryPointCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..d04425d9e08f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 and . + /// + public abstract partial class DataReplicationRecoveryPointCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationRecoveryPointCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs new file mode 100644 index 000000000000..645e11dce03f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationRecoveryPointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn, "O"); + writer.WritePropertyName("recoveryPointType"u8); + writer.WriteStringValue(RecoveryPointType.ToString()); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationRecoveryPointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointProperties(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointProperties DeserializeDataReplicationRecoveryPointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset recoveryPointTime = default; + DataReplicationRecoveryPointType recoveryPointType = default; + DataReplicationRecoveryPointCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointTime"u8)) + { + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recoveryPointType"u8)) + { + recoveryPointType = new DataReplicationRecoveryPointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationRecoveryPointCustomProperties.DeserializeDataReplicationRecoveryPointCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationRecoveryPointProperties(recoveryPointTime, recoveryPointType, customProperties, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs new file mode 100644 index 000000000000..2e6b0d219eba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Recovery point model properties. + public partial class DataReplicationRecoveryPointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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 and . + /// + /// is null. + internal DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn, DataReplicationRecoveryPointType recoveryPointType, DataReplicationRecoveryPointCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// 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 and . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn, DataReplicationRecoveryPointType recoveryPointType, DataReplicationRecoveryPointCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationRecoveryPointProperties() + { + } + + /// Gets or sets the recovery point time. + public DateTimeOffset RecoveryPointOn { get; } + /// Gets or sets the recovery point type. + public DataReplicationRecoveryPointType 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 and . + /// + public DataReplicationRecoveryPointCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the recovery point item. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs new file mode 100644 index 000000000000..1b121feecf9d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.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 DataReplicationRecoveryPointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationRecoveryPointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationConsistentValue = "ApplicationConsistent"; + private const string CrashConsistentValue = "CrashConsistent"; + + /// Application consistent recovery point. + public static DataReplicationRecoveryPointType ApplicationConsistent { get; } = new DataReplicationRecoveryPointType(ApplicationConsistentValue); + /// Crash consistent recovery point. + public static DataReplicationRecoveryPointType CrashConsistent { get; } = new DataReplicationRecoveryPointType(CrashConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationRecoveryPointType left, DataReplicationRecoveryPointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationRecoveryPointType left, DataReplicationRecoveryPointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationRecoveryPointType(string value) => new DataReplicationRecoveryPointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationRecoveryPointType other && Equals(other); + /// + public bool Equals(DataReplicationRecoveryPointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs new file mode 100644 index 000000000000..ed5b55c1b4e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.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 DataReplicationResynchronizationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationResynchronizationState(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"; + + /// Resynchronization is not active. + public static DataReplicationResynchronizationState None { get; } = new DataReplicationResynchronizationState(NoneValue); + /// Resynchronization has been initiated. + public static DataReplicationResynchronizationState ResynchronizationInitiated { get; } = new DataReplicationResynchronizationState(ResynchronizationInitiatedValue); + /// Resynchronization has been completed successfully. + public static DataReplicationResynchronizationState ResynchronizationCompleted { get; } = new DataReplicationResynchronizationState(ResynchronizationCompletedValue); + /// Resynchronization has failed and would need to be started again. + public static DataReplicationResynchronizationState ResynchronizationFailed { get; } = new DataReplicationResynchronizationState(ResynchronizationFailedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationResynchronizationState left, DataReplicationResynchronizationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationResynchronizationState left, DataReplicationResynchronizationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationResynchronizationState(string value) => new DataReplicationResynchronizationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationResynchronizationState other && Equals(other); + /// + public bool Equals(DataReplicationResynchronizationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs new file mode 100644 index 000000000000..4a47cb75d165 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TaskName)) + { + writer.WritePropertyName("taskName"u8); + writer.WriteStringValue(TaskName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (Optional.IsCollectionDefined(ChildrenJobs)) + { + writer.WritePropertyName("childrenJobs"u8); + writer.WriteStartArray(); + foreach (var item in ChildrenJobs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationTask IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationTask(document.RootElement, options); + } + + internal static DataReplicationTask DeserializeDataReplicationTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string taskName = default; + DataReplicationTaskState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + DataReplicationTaskCustomProperties customProperties = default; + IReadOnlyList childrenJobs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 DataReplicationTaskState(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 = DataReplicationTaskCustomProperties.DeserializeDataReplicationTaskCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("childrenJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationJobData.DeserializeDataReplicationJobData(item, options)); + } + childrenJobs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationTask( + taskName, + state, + startTime, + endTime, + customProperties, + childrenJobs ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationTask IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs new file mode 100644 index 000000000000..200254809b07 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model. + public partial class DataReplicationTask + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationTask() + { + ChildrenJobs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// 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 job models. + /// Keeps track of any properties unknown to the library. + internal DataReplicationTask(string taskName, DataReplicationTaskState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, DataReplicationTaskCustomProperties customProperties, IReadOnlyList childrenJobs, IDictionary serializedAdditionalRawData) + { + TaskName = taskName; + State = state; + StartOn = startOn; + EndOn = endOn; + CustomProperties = customProperties; + ChildrenJobs = childrenJobs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the task name. + public string TaskName { get; } + /// Gets or sets the task state. + public DataReplicationTaskState? 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 DataReplicationTaskCustomProperties CustomProperties { get; } + /// Gets or sets the instance type. + public string CustomInstanceType + { + get => CustomProperties?.InstanceType; + } + + /// Gets or sets the list of children job models. + public IReadOnlyList ChildrenJobs { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs new file mode 100644 index 000000000000..281d9de61ed6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class DataReplicationTaskCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationTaskCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationTaskCustomProperties(document.RootElement, options); + } + + internal static DataReplicationTaskCustomProperties DeserializeDataReplicationTaskCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationTaskCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationTaskCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationTaskCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs new file mode 100644 index 000000000000..ca8da00a4de1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model custom properties. + internal partial class DataReplicationTaskCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the instance type. + /// is null. + internal DataReplicationTaskCustomProperties(string instanceType) + { + Argument.AssertNotNull(instanceType, nameof(instanceType)); + + InstanceType = instanceType; + } + + /// Initializes a new instance of . + /// Gets or sets the instance type. + /// Keeps track of any properties unknown to the library. + internal DataReplicationTaskCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationTaskCustomProperties() + { + } + + /// Gets or sets the instance type. + public string InstanceType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs new file mode 100644 index 000000000000..b8f653efd661 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.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 DataReplicationTaskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationTaskState(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"; + + /// Task has not been started. + public static DataReplicationTaskState Pending { get; } = new DataReplicationTaskState(PendingValue); + /// Task is in progress. + public static DataReplicationTaskState Started { get; } = new DataReplicationTaskState(StartedValue); + /// Task has completed successfully. + public static DataReplicationTaskState Succeeded { get; } = new DataReplicationTaskState(SucceededValue); + /// Task failed. + public static DataReplicationTaskState Failed { get; } = new DataReplicationTaskState(FailedValue); + /// Task has been cancelled. + public static DataReplicationTaskState Cancelled { get; } = new DataReplicationTaskState(CancelledValue); + /// Task has been skipped. + public static DataReplicationTaskState Skipped { get; } = new DataReplicationTaskState(SkippedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationTaskState left, DataReplicationTaskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationTaskState left, DataReplicationTaskState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationTaskState(string value) => new DataReplicationTaskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationTaskState other && Equals(other); + /// + public bool Equals(DataReplicationTaskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs new file mode 100644 index 000000000000..35bd3e4557c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.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 DataReplicationTestFailoverState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationTestFailoverState(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"; + + /// Test failover is not active. + public static DataReplicationTestFailoverState None { get; } = new DataReplicationTestFailoverState(NoneValue); + /// Test failover has been initiated. + public static DataReplicationTestFailoverState TestFailoverInitiated { get; } = new DataReplicationTestFailoverState(TestFailoverInitiatedValue); + /// Preparing test protected entities is in progress. + public static DataReplicationTestFailoverState TestFailoverCompleting { get; } = new DataReplicationTestFailoverState(TestFailoverCompletingValue); + /// Test failover has been completed successfully. + public static DataReplicationTestFailoverState TestFailoverCompleted { get; } = new DataReplicationTestFailoverState(TestFailoverCompletedValue); + /// Test failover initiation failed.. + public static DataReplicationTestFailoverState TestFailoverFailed { get; } = new DataReplicationTestFailoverState(TestFailoverFailedValue); + /// Preparing test protected entities failed. + public static DataReplicationTestFailoverState TestFailoverCompletionFailed { get; } = new DataReplicationTestFailoverState(TestFailoverCompletionFailedValue); + /// Test failover cleanup has been initiated. + public static DataReplicationTestFailoverState TestFailoverCleanupInitiated { get; } = new DataReplicationTestFailoverState(TestFailoverCleanupInitiatedValue); + /// Cleaning up test protected entities is in progress. + public static DataReplicationTestFailoverState TestFailoverCleanupCompleting { get; } = new DataReplicationTestFailoverState(TestFailoverCleanupCompletingValue); + /// Test failover cleanup has completed/failed. This is a transient state before the state is moved back to None. + public static DataReplicationTestFailoverState MarkedForDeletion { get; } = new DataReplicationTestFailoverState(MarkedForDeletionValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationTestFailoverState left, DataReplicationTestFailoverState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationTestFailoverState left, DataReplicationTestFailoverState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationTestFailoverState(string value) => new DataReplicationTestFailoverState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationTestFailoverState other && Equals(other); + /// + public bool Equals(DataReplicationTestFailoverState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs new file mode 100644 index 000000000000..baf64f60bdd3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationVaultPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + 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, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + } + + DataReplicationVaultPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultPatch(document.RootElement, options); + } + + internal static DataReplicationVaultPatch DeserializeDataReplicationVaultPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DataReplicationVaultProperties properties = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationVaultProperties.DeserializeDataReplicationVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs new file mode 100644 index 000000000000..aff777c9c300 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Vault model update. + public partial class DataReplicationVaultPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationVaultPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, DataReplicationVaultProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Vault properties. + public DataReplicationVaultProperties Properties { get; set; } + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs new file mode 100644 index 000000000000..99cfd8c3a677 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationVaultProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (Optional.IsDefined(VaultType)) + { + writer.WritePropertyName("vaultType"u8); + writer.WriteStringValue(VaultType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultProperties(document.RootElement, options); + } + + internal static DataReplicationVaultProperties DeserializeDataReplicationVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + ResourceIdentifier serviceResourceId = default; + DataReplicationVaultType? vaultType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vaultType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vaultType = new DataReplicationVaultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultProperties(provisioningState, serviceResourceId, vaultType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs new file mode 100644 index 000000000000..7464d2a973bc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs @@ -0,0 +1,74 @@ +// 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 +{ + /// Vault properties. + public partial class DataReplicationVaultProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationVaultProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultProperties(DataReplicationProvisioningState? provisioningState, ResourceIdentifier serviceResourceId, DataReplicationVaultType? vaultType, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceResourceId = serviceResourceId; + VaultType = vaultType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the vault. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the service resource Id. + public ResourceIdentifier ServiceResourceId { get; } + /// Gets or sets the type of vault. + public DataReplicationVaultType? VaultType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs new file mode 100644 index 000000000000..57ab10259484 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.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 DataReplicationVaultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationVaultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisasterRecoveryValue = "DisasterRecovery"; + private const string MigrateValue = "Migrate"; + + /// Disaster recovery vault. + public static DataReplicationVaultType DisasterRecovery { get; } = new DataReplicationVaultType(DisasterRecoveryValue); + /// Migrate vault. + public static DataReplicationVaultType Migrate { get; } = new DataReplicationVaultType(MigrateValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationVaultType left, DataReplicationVaultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationVaultType left, DataReplicationVaultType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationVaultType(string value) => new DataReplicationVaultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationVaultType other && Equals(other); + /// + public bool Equals(DataReplicationVaultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs new file mode 100644 index 000000000000..cda304f953d0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflight : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflight IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflight(document.RootElement, options); + } + + internal static DeploymentPreflight DeserializeDeploymentPreflight(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(DeploymentPreflightResourceInfo.DeserializeDeploymentPreflightResourceInfo(item, options)); + } + resources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflight(resources ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflight IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentPreflight(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs new file mode 100644 index 000000000000..dc4c10606cd4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Deployment preflight model. + public partial class DeploymentPreflight + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentPreflight() + { + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the list of resources. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflight(IList resources, IDictionary serializedAdditionalRawData) + { + Resources = resources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the list of resources. + public IList Resources { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs new file mode 100644 index 000000000000..85fb6f33718c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflightResourceInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(ApiVersion)) + { + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Properties); +#else + using (JsonDocument document = JsonDocument.Parse(Properties, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflightResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflightResourceInfo(document.RootElement, options); + } + + internal static DeploymentPreflightResourceInfo DeserializeDeploymentPreflightResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ResourceType? type = default; + AzureLocation? location = default; + string apiVersion = default; + BinaryData properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResourceType(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; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflightResourceInfo( + name, + type, + location, + apiVersion, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflightResourceInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentPreflightResourceInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs new file mode 100644 index 000000000000..ff63b5899143 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs @@ -0,0 +1,111 @@ +// 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 +{ + /// Deployment preflight resource. + public partial class DeploymentPreflightResourceInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentPreflightResourceInfo() + { + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets the properties of the resource. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflightResourceInfo(string name, ResourceType? type, AzureLocation? location, string apiVersion, BinaryData properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + Location = location; + ApiVersion = apiVersion; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public ResourceType? Type { 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; } + /// + /// Gets or sets the properties of the resource. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs new file mode 100644 index 000000000000..081ec49f6980 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EmailConfigurationModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmailConfigurationModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + + internal static EmailConfigurationModelListResult DeserializeEmailConfigurationModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmailConfigurationModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EmailConfigurationModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs new file mode 100644 index 000000000000..9bbfe88efaa3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EmailConfigurationModel list operation. + internal partial class EmailConfigurationModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The EmailConfigurationModel items on this page. + /// is null. + internal EmailConfigurationModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EmailConfigurationModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EmailConfigurationModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmailConfigurationModelListResult() + { + } + + /// The EmailConfigurationModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs new file mode 100644 index 000000000000..2800a1ba6862 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EventModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EventModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelListResult(document.RootElement, options); + } + + internal static EventModelListResult DeserializeEventModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationEventData.DeserializeDataReplicationEventData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EventModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EventModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEventModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs new file mode 100644 index 000000000000..5b38c81917c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EventModel list operation. + internal partial class EventModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The EventModel items on this page. + /// is null. + internal EventModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EventModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EventModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EventModelListResult() + { + } + + /// The EventModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs new file mode 100644 index 000000000000..26240dfd2198 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricAgentModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricAgentModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + + internal static FabricAgentModelListResult DeserializeFabricAgentModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricAgentModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs new file mode 100644 index 000000000000..d93ed1a75ee9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricAgentModel list operation. + internal partial class FabricAgentModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FabricAgentModel items on this page. + /// is null. + internal FabricAgentModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricAgentModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricAgentModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricAgentModelListResult() + { + } + + /// The FabricAgentModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs new file mode 100644 index 000000000000..06e88d60a819 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelListResult(document.RootElement, options); + } + + internal static FabricModelListResult DeserializeFabricModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationFabricData.DeserializeDataReplicationFabricData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFabricModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs new file mode 100644 index 000000000000..ab056421422d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricModel list operation. + internal partial class FabricModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FabricModel items on this page. + /// is null. + internal FabricModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricModelListResult() + { + } + + /// The FabricModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c2e44f04514d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + FailoverJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverJobCustomProperties(document.RootElement, options); + } + + internal static FailoverJobCustomProperties DeserializeFailoverJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFailoverJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs new file mode 100644 index 000000000000..4a880d47abb7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover job model custom properties. + public partial class FailoverJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal FailoverJobCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "FailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the failed over protected item details. + internal FailoverJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "FailoverJobDetails"; + } + + /// Gets or sets the failed over protected item details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} 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..f357aea83ef2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverProtectedItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProtectedItemName)) + { + writer.WritePropertyName("protectedItemName"u8); + writer.WriteStringValue(ProtectedItemName); + } + if (options.Format != "W" && Optional.IsDefined(VmName)) + { + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + } + if (options.Format != "W" && Optional.IsDefined(TestVmName)) + { + writer.WritePropertyName("testVmName"u8); + writer.WriteStringValue(TestVmName); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointId)) + { + writer.WritePropertyName("recoveryPointId"u8); + writer.WriteStringValue(RecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointOn)) + { + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FailoverProtectedItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + + internal static FailoverProtectedItemProperties DeserializeFailoverProtectedItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string protectedItemName = default; + string vmName = default; + string testVmName = default; + string recoveryPointId = default; + DateTimeOffset? recoveryPointTime = default; + string networkName = default; + string subnet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverProtectedItemProperties( + protectedItemName, + vmName, + testVmName, + recoveryPointId, + recoveryPointTime, + networkName, + subnet, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverProtectedItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..ba5635ae92a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover properties of the protected item. + public partial class FailoverProtectedItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FailoverProtectedItemProperties() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal FailoverProtectedItemProperties(string protectedItemName, string vmName, string testVmName, string recoveryPointId, DateTimeOffset? recoveryPointOn, string networkName, string subnet, IDictionary serializedAdditionalRawData) + { + ProtectedItemName = protectedItemName; + VmName = vmName; + TestVmName = testVmName; + RecoveryPointId = recoveryPointId; + RecoveryPointOn = recoveryPointOn; + NetworkName = networkName; + Subnet = subnet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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/GroupConnectivityInformation.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs new file mode 100644 index 000000000000..e45737e0666f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class GroupConnectivityInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (Optional.IsCollectionDefined(CustomerVisibleFqdns)) + { + writer.WritePropertyName("customerVisibleFqdns"u8); + writer.WriteStartArray(); + foreach (var item in CustomerVisibleFqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(InternalFqdn)) + { + writer.WritePropertyName("internalFqdn"u8); + writer.WriteStringValue(InternalFqdn); + } + if (Optional.IsDefined(RedirectMapId)) + { + writer.WritePropertyName("redirectMapId"u8); + writer.WriteStringValue(RedirectMapId); + } + if (Optional.IsDefined(PrivateLinkServiceArmRegion)) + { + writer.WritePropertyName("privateLinkServiceArmRegion"u8); + writer.WriteStringValue(PrivateLinkServiceArmRegion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupConnectivityInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + + internal static GroupConnectivityInformation DeserializeGroupConnectivityInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + string memberName = default; + IList customerVisibleFqdns = default; + string internalFqdn = default; + string redirectMapId = default; + string privateLinkServiceArmRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerVisibleFqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customerVisibleFqdns = array; + continue; + } + if (property.NameEquals("internalFqdn"u8)) + { + internalFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("redirectMapId"u8)) + { + redirectMapId = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceArmRegion"u8)) + { + privateLinkServiceArmRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupConnectivityInformation( + groupId, + memberName, + customerVisibleFqdns ?? new ChangeTrackingList(), + internalFqdn, + redirectMapId, + privateLinkServiceArmRegion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support writing '{options.Format}' format."); + } + } + + GroupConnectivityInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs new file mode 100644 index 000000000000..bc4ad49ffc23 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.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; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of a connection's group information. + public partial class GroupConnectivityInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GroupConnectivityInformation() + { + CustomerVisibleFqdns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets group id. + /// Gets or sets member name. + /// Gets or sets customer visible FQDNs. + /// Gets or sets Internal Fqdn. + /// Gets or sets the redirect map id. + /// Gets or sets the private link service arm region. + /// Keeps track of any properties unknown to the library. + internal GroupConnectivityInformation(string groupId, string memberName, IList customerVisibleFqdns, string internalFqdn, string redirectMapId, string privateLinkServiceArmRegion, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + MemberName = memberName; + CustomerVisibleFqdns = customerVisibleFqdns; + InternalFqdn = internalFqdn; + RedirectMapId = redirectMapId; + PrivateLinkServiceArmRegion = privateLinkServiceArmRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + /// Gets or sets customer visible FQDNs. + public IList CustomerVisibleFqdns { get; } + /// Gets or sets Internal Fqdn. + public string InternalFqdn { get; set; } + /// Gets or sets the redirect map id. + public string RedirectMapId { get; set; } + /// Gets or sets the private link service arm region. + public string PrivateLinkServiceArmRegion { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d97b9e9eac59 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVMigrateFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri.AbsoluteUri); + } + } + + HyperVMigrateFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVMigrateFabricCustomProperties(document.RootElement, options); + } + + internal static HyperVMigrateFabricCustomProperties DeserializeHyperVMigrateFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier hyperVSiteId = default; + ResourceIdentifier fabricResourceId = default; + ResourceIdentifier fabricContainerId = default; + ResourceIdentifier migrationSolutionId = default; + Uri migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVMigrateFabricCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVMigrateFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVMigrateFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs new file mode 100644 index 000000000000..2a30f572c1ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV migrate fabric model custom properties. + public partial class HyperVMigrateFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the migration solution ARM Id. + /// or is null. + public HyperVMigrateFabricCustomProperties(ResourceIdentifier hyperVSiteId, ResourceIdentifier migrationSolutionId) + { + Argument.AssertNotNull(hyperVSiteId, nameof(hyperVSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + HyperVSiteId = hyperVSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "HyperVMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 HyperVMigrateFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier hyperVSiteId, ResourceIdentifier fabricResourceId, ResourceIdentifier fabricContainerId, ResourceIdentifier migrationSolutionId, Uri migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + HyperVSiteId = hyperVSiteId; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "HyperVMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVMigrateFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the HyperV site. + public ResourceIdentifier HyperVSiteId { get; set; } + /// Gets or sets the fabric resource Id. + public ResourceIdentifier FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public ResourceIdentifier FabricContainerId { get; } + /// Gets or sets the migration solution ARM Id. + public ResourceIdentifier 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..dbcfff779234 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support writing '{format}' format."); + } + + 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); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciDiskInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciDiskInput(document.RootElement, options); + } + + internal static HyperVToAzStackHciDiskInput DeserializeHyperVToAzStackHciDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + ResourceIdentifier storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DataReplicationDiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(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; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DataReplicationDiskControllerInputs.DeserializeDataReplicationDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..f068fa12789e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.cs @@ -0,0 +1,123 @@ +// 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 +{ + /// HyperVToAzStack disk input. + public partial class HyperVToAzStackHciDiskInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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 . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciDiskInput(string diskId, ResourceIdentifier storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DataReplicationDiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public ResourceIdentifier 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; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DataReplicationDiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..41f5e3f66ed1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + HyperVToAzStackHciEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciEventCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciEventCustomProperties DeserializeHyperVToAzStackHciEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciEventCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs new file mode 100644 index 000000000000..4d1862609196 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +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 HyperVToAzStackHciEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHciEventCustomProperties() + { + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 HyperVToAzStackHciEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + 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..c600288d66cb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciNicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciNicInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciNicInput(document.RootElement, options); + } + + internal static HyperVToAzStackHciNicInput DeserializeHyperVToAzStackHciNicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciNicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciNicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciNicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..d136c4f96124 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHciNicInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the selection type of the NIC. + /// is null. + public HyperVToAzStackHciNicInput(string nicId, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + + NicId = nicId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciNicInput(string nicId, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciNicInput() + { + } + + /// 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; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..7963bb467403 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + HyperVToAzStackHciPlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciPlannedFailoverCustomProperties DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciPlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..c3ab7b48e6b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI planned failover model custom properties. + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal HyperVToAzStackHciPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciPlannedFailoverCustomProperties() + { + } + + /// 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/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..94c37cdc15fd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + HyperVToAzStackHciPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciPolicyCustomProperties DeserializeHyperVToAzStackHciPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciPolicyCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs new file mode 100644 index 000000000000..8b37d53437ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV To AzStackHCI Policy model custom properties. + public partial class HyperVToAzStackHciPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// 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 HyperVToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 HyperVToAzStackHciPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciPolicyCustomProperties() + { + } + + /// 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..9a1b891da3c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.Serialization.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciProtectedDiskProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedDiskProperties DeserializeHyperVToAzStackHciProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(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; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..acc4cc016afa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.cs @@ -0,0 +1,118 @@ +// 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 +{ + /// HyperVToAzStackHCI protected disk properties. + public partial class HyperVToAzStackHciProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHciProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public ResourceIdentifier 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; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..aa1d7de6cb0b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + 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, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceivedOn)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceivedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + HyperVToAzStackHciProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedItemCustomProperties DeserializeHyperVToAzStackHciProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + ResourceIdentifier targetHciClusterId = default; + ResourceIdentifier targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + ResourceIdentifier fabricDiscoveryMachineId = default; + IList disksToInclude = default; + IList nicsToInclude = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string targetVmName = default; + ResourceIdentifier targetResourceGroupId = default; + ResourceIdentifier storageContainerId = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string osType = default; + string osName = default; + string firmwareType = default; + string targetLocation = default; + string customLocationRegion = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? resyncProgressPercentage = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = new ResourceIdentifier(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, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciNicInput.DeserializeHyperVToAzStackHciNicInput(item, options)); + } + 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 = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = new ResourceIdentifier(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, options); + 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("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = 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, options)); + } + 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, options)); + } + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedItemCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude, + nicsToInclude, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + lastReplicationUpdateTime); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..e8e5d023be87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs @@ -0,0 +1,234 @@ +// 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 HyperVToAzStackHciProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// 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 fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// , , , , , , , , , , or is null. + public HyperVToAzStackHciProtectedItemCustomProperties(ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, ResourceIdentifier fabricDiscoveryMachineId, IEnumerable disksToInclude, IEnumerable nicsToInclude, ResourceIdentifier targetResourceGroupId, ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, 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(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + 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; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + CustomLocationRegion = customLocationRegion; + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 fabric agent name. + /// Gets or sets the target fabric agent 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 HyperVToAzStackHciProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, string targetAzStackHciClusterName, ResourceIdentifier fabricDiscoveryMachineId, IList disksToInclude, IList nicsToInclude, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string targetVmName, ResourceIdentifier targetResourceGroupId, ResourceIdentifier storageContainerId, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string osType, string osName, string firmwareType, string targetLocation, string customLocationRegion, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceivedOn, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? resyncProgressPercentage, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + 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; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceivedOn = lastRecoveryPointReceivedOn; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciProtectedItemCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public ResourceIdentifier TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public ResourceIdentifier 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 ResourceIdentifier 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 ResourceIdentifier TargetResourceGroupId { get; set; } + /// Gets or sets the target storage container ARM Id. + public ResourceIdentifier 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 fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { 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? LastRecoveryPointReceivedOn { 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/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..cf22dc4d6abf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + HyperVToAzStackHciProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedItemCustomPropertiesUpdate DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciNicInput.DeserializeHyperVToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + 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, options); + 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("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedItemCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..60ddff5d5d04 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// 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. + internal HyperVToAzStackHciProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// 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; set; } + } +} 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..eb43688fd7f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciProtectedNicProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedNicProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedNicProperties DeserializeHyperVToAzStackHciProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedNicProperties( + nicId, + macAddress, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..0d997349cd48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHciProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHciProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciProtectedNicProperties(string nicId, string macAddress, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..71f46123f8ca --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + HyperVToAzStackHciRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciRecoveryPointCustomProperties DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..423a260e63f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI recovery point model custom properties. + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHciRecoveryPointCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal HyperVToAzStackHciRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + 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/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..676688496aeb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVFabricArmId"u8); + writer.WriteStringValue(HyperVFabricArmId); + if (options.Format != "W" && Optional.IsDefined(HyperVSiteId)) + { + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + HyperVToAzStackHciReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciReplicationExtensionCustomProperties DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier hyperVFabricArmId = default; + ResourceIdentifier hyperVSiteId = default; + ResourceIdentifier azStackHciFabricArmId = default; + ResourceIdentifier azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + Uri asrServiceUri = default; + Uri rcmServiceUri = default; + Uri gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVFabricArmId"u8)) + { + hyperVFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("hyperVSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hyperVSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azStackHciSiteId = new ResourceIdentifier(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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciReplicationExtensionCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..ff1bc33be8dc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs @@ -0,0 +1,109 @@ +// 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 +{ + /// HyperV to AzStackHCI Replication extension model custom properties. + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// 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 HyperVToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier hyperVFabricArmId, ResourceIdentifier azStackHciFabricArmId) + { + Argument.AssertNotNull(hyperVFabricArmId, nameof(hyperVFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + HyperVFabricArmId = hyperVFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 HyperVToAzStackHciReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier hyperVFabricArmId, ResourceIdentifier hyperVSiteId, ResourceIdentifier azStackHciFabricArmId, ResourceIdentifier 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, serializedAdditionalRawData) + { + 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"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciReplicationExtensionCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source HyperV fabric. + public ResourceIdentifier HyperVFabricArmId { get; set; } + /// Gets or sets the ARM Id of the HyperV site. + public ResourceIdentifier HyperVSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public ResourceIdentifier AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier 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/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs new file mode 100644 index 000000000000..6dc6eaec0184 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class JobModelCustomPropertiesAffectedObjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelCustomPropertiesAffectedObjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + + internal static JobModelCustomPropertiesAffectedObjectDetails DeserializeJobModelCustomPropertiesAffectedObjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + JobModelCustomPropertiesAffectedObjectDetailsType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new JobModelCustomPropertiesAffectedObjectDetailsType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{options.Format}' format."); + } + } + + JobModelCustomPropertiesAffectedObjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs new file mode 100644 index 000000000000..f164407b0c96 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails. + public partial class JobModelCustomPropertiesAffectedObjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal JobModelCustomPropertiesAffectedObjectDetails() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal JobModelCustomPropertiesAffectedObjectDetails(string description, JobModelCustomPropertiesAffectedObjectDetailsType? type, IDictionary serializedAdditionalRawData) + { + Description = description; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the description. + public string Description { get; } + /// Gets the type. + public JobModelCustomPropertiesAffectedObjectDetailsType? Type { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs new file mode 100644 index 000000000000..fbc06c6e77d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails_type. + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ObjectValue = "object"; + + /// object. + public static JobModelCustomPropertiesAffectedObjectDetailsType Object { get; } = new JobModelCustomPropertiesAffectedObjectDetailsType(ObjectValue); + /// Determines if two values are the same. + public static bool operator ==(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobModelCustomPropertiesAffectedObjectDetailsType(string value) => new JobModelCustomPropertiesAffectedObjectDetailsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobModelCustomPropertiesAffectedObjectDetailsType other && Equals(other); + /// + public bool Equals(JobModelCustomPropertiesAffectedObjectDetailsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs new file mode 100644 index 000000000000..4afd95b6c9a9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class JobModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelListResult(document.RootElement, options); + } + + internal static JobModelListResult DeserializeJobModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationJobData.DeserializeDataReplicationJobData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{options.Format}' format."); + } + } + + JobModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeJobModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs new file mode 100644 index 000000000000..a7ada724de79 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a JobModel list operation. + internal partial class JobModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The JobModel items on this page. + /// is null. + internal JobModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The JobModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal JobModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal JobModelListResult() + { + } + + /// The JobModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs new file mode 100644 index 000000000000..b7b40b75f053 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailover : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailover)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailover IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailover)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailover(document.RootElement, options); + } + + internal static PlannedFailover DeserializePlannedFailover(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = PlannedFailoverProperties.DeserializePlannedFailoverProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailover(properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PlannedFailover)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailover IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailover(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailover)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs new file mode 100644 index 000000000000..b63eeed155b3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model. + public partial class PlannedFailover + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Planned failover model properties. + /// is null. + public PlannedFailover(PlannedFailoverProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Planned failover model properties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailover(PlannedFailoverProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailover() + { + } + + /// Planned failover model properties. + internal PlannedFailoverProperties 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 PlannedFailoverCustomProperties PlannedFailoverCustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set => Properties = new PlannedFailoverProperties(value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f3e967ca083c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownPlannedFailoverCustomProperties))] + public partial class PlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static PlannedFailoverCustomProperties DeserializePlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciPlannedFailoverCustomProperties.DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciPlannedFailoverCustomProperties.DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(element, options); + } + } + return UnknownPlannedFailoverCustomProperties.DeserializeUnknownPlannedFailoverCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..f1d984795625 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.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 PlannedFailoverCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected PlannedFailoverCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for PlannedFailoverCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs new file mode 100644 index 000000000000..97a9cd867549 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailoverProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverProperties(document.RootElement, options); + } + + internal static PlannedFailoverProperties DeserializePlannedFailoverProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + customProperties = PlannedFailoverCustomProperties.DeserializePlannedFailoverCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailoverProperties(customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs new file mode 100644 index 000000000000..288367ca8ed5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model properties. + public partial class PlannedFailoverProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// 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 PlannedFailoverProperties(PlannedFailoverCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// + /// 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 . + /// + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverProperties(PlannedFailoverCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailoverProperties() + { + } + + /// + /// 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 PlannedFailoverCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs new file mode 100644 index 000000000000..d4778253ba37 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PolicyModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PolicyModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelListResult(document.RootElement, options); + } + + internal static PolicyModelListResult DeserializePolicyModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPolicyData.DeserializeDataReplicationPolicyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PolicyModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePolicyModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs new file mode 100644 index 000000000000..d4fceabe846d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PolicyModel list operation. + internal partial class PolicyModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PolicyModel items on this page. + /// is null. + internal PolicyModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PolicyModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PolicyModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PolicyModelListResult() + { + } + + /// The PolicyModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs new file mode 100644 index 000000000000..03fc34b6fb80 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PrivateEndpointConnectionProxyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateEndpointConnectionProxyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + + internal static PrivateEndpointConnectionProxyListResult DeserializePrivateEndpointConnectionProxyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateEndpointConnectionProxyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionProxyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs new file mode 100644 index 000000000000..be2432e6561c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnectionProxy list operation. + internal partial class PrivateEndpointConnectionProxyListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateEndpointConnectionProxy items on this page. + /// is null. + internal PrivateEndpointConnectionProxyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnectionProxy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionProxyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrivateEndpointConnectionProxyListResult() + { + } + + /// The PrivateEndpointConnectionProxy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} 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..e7fb5c914aed --- /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"; + + /// Protected item is active on Primary. + public static ProtectedItemActiveLocation Primary { get; } = new ProtectedItemActiveLocation(PrimaryValue); + /// Protected item is active on 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 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..e7e0faaff065 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemDynamicMemoryConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("maximumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MaximumMemoryInMegaBytes); + writer.WritePropertyName("minimumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MinimumMemoryInMegaBytes); + writer.WritePropertyName("targetMemoryBufferPercentage"u8); + writer.WriteNumberValue(TargetMemoryBufferPercentage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemDynamicMemoryConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + + internal static ProtectedItemDynamicMemoryConfig DeserializeProtectedItemDynamicMemoryConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long maximumMemoryInMegaBytes = default; + long minimumMemoryInMegaBytes = default; + int targetMemoryBufferPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemDynamicMemoryConfig(maximumMemoryInMegaBytes, minimumMemoryInMegaBytes, targetMemoryBufferPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemDynamicMemoryConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..95f93ff06669 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item dynamic memory config. + public partial class ProtectedItemDynamicMemoryConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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; + } + + /// Initializes a new instance of . + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage, IDictionary serializedAdditionalRawData) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemDynamicMemoryConfig() + { + } + + /// 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..218652cd394d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ScenarioName)) + { + writer.WritePropertyName("scenarioName"u8); + writer.WriteStringValue(ScenarioName); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + + internal static ProtectedItemJobProperties DeserializeProtectedItemJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string scenarioName = default; + string id = default; + string name = default; + string displayName = default; + string state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemJobProperties( + scenarioName, + id, + name, + displayName, + state, + startTime, + endTime, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..f19142061375 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item job properties. + public partial class ProtectedItemJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProtectedItemJobProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemJobProperties(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + { + ScenarioName = scenarioName; + Id = id; + Name = name; + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets protection scenario name. + public string ScenarioName { get; } + /// Gets or sets job Id. + public string Id { get; } + /// Gets or sets job name. + public string Name { get; } + /// Gets or sets the job friendly display name. + public string DisplayName { get; } + /// Gets or sets job state. + public string State { get; } + /// Gets or sets start time of the job. + public DateTimeOffset? StartOn { get; } + /// Gets or sets end time of the job. + public DateTimeOffset? EndOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs new file mode 100644 index 000000000000..5d4e9f965505 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ProtectedItemModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + + internal static ProtectedItemModelListResult DeserializeProtectedItemModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs new file mode 100644 index 000000000000..572c7890028f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ProtectedItemModel list operation. + internal partial class ProtectedItemModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ProtectedItemModel items on this page. + /// is null. + internal ProtectedItemModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ProtectedItemModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemModelListResult() + { + } + + /// The ProtectedItemModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs new file mode 100644 index 000000000000..353c66ad59df --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryPointModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryPointModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + + internal static RecoveryPointModelListResult DeserializeRecoveryPointModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryPointModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs new file mode 100644 index 000000000000..342601dba457 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a RecoveryPointModel list operation. + internal partial class RecoveryPointModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The RecoveryPointModel items on this page. + /// is null. + internal RecoveryPointModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The RecoveryPointModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryPointModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryPointModelListResult() + { + } + + /// The RecoveryPointModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..652fdb81503d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateEndpointConnectionListResult DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..f97dae4b52f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnection list operation. + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult() + { + } + + /// The PrivateEndpointConnection items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..f56d12fbd7e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkResourceListResult DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateLinkResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..b5476f002771 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateLinkResource list operation. + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult() + { + } + + /// The PrivateLinkResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs new file mode 100644 index 000000000000..44f20b143444 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RemotePrivateEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsCollectionDefined(PrivateLinkServiceConnections)) + { + writer.WritePropertyName("privateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ManualPrivateLinkServiceConnections)) + { + writer.WritePropertyName("manualPrivateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in ManualPrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PrivateLinkServiceProxies)) + { + writer.WritePropertyName("privateLinkServiceProxies"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceProxies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectionDetails)) + { + writer.WritePropertyName("connectionDetails"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RemotePrivateEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + + internal static RemotePrivateEndpoint DeserializeRemotePrivateEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList privateLinkServiceConnections = default; + IList manualPrivateLinkServiceConnections = default; + IList privateLinkServiceProxies = default; + IList connectionDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceConnection.DeserializeDataReplicationPrivateLinkServiceConnection(item, options)); + } + privateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("manualPrivateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceConnection.DeserializeDataReplicationPrivateLinkServiceConnection(item, options)); + } + manualPrivateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("privateLinkServiceProxies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceProxy.DeserializeDataReplicationPrivateLinkServiceProxy(item, options)); + } + privateLinkServiceProxies = array; + continue; + } + if (property.NameEquals("connectionDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RemotePrivateEndpointConnectionDetails.DeserializeRemotePrivateEndpointConnectionDetails(item, options)); + } + connectionDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemotePrivateEndpoint( + id, + privateLinkServiceConnections ?? new ChangeTrackingList(), + manualPrivateLinkServiceConnections ?? new ChangeTrackingList(), + privateLinkServiceProxies ?? new ChangeTrackingList(), + connectionDetails ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{options.Format}' format."); + } + } + + RemotePrivateEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs new file mode 100644 index 000000000000..9522d06a8c7b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represent remote private endpoint information for the private endpoint connection proxy. + public partial class RemotePrivateEndpoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// is null. + public RemotePrivateEndpoint(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + PrivateLinkServiceConnections = new ChangeTrackingList(); + ManualPrivateLinkServiceConnections = new ChangeTrackingList(); + PrivateLinkServiceProxies = new ChangeTrackingList(); + ConnectionDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + /// Gets or sets the list of private link service proxies. + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + /// Keeps track of any properties unknown to the library. + internal RemotePrivateEndpoint(string id, IList privateLinkServiceConnections, IList manualPrivateLinkServiceConnections, IList privateLinkServiceProxies, IList connectionDetails, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateLinkServiceConnections = privateLinkServiceConnections; + ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + PrivateLinkServiceProxies = privateLinkServiceProxies; + ConnectionDetails = connectionDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemotePrivateEndpoint() + { + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + public IList PrivateLinkServiceConnections { get; } + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + public IList ManualPrivateLinkServiceConnections { get; } + /// Gets or sets the list of private link service proxies. + public IList PrivateLinkServiceProxies { get; } + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + public IList ConnectionDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs new file mode 100644 index 000000000000..90c4267447b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RemotePrivateEndpointConnectionDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(PrivateIPAddress)) + { + writer.WritePropertyName("privateIpAddress"u8); + writer.WriteStringValue(PrivateIPAddress); + } + if (Optional.IsDefined(LinkIdentifier)) + { + writer.WritePropertyName("linkIdentifier"u8); + writer.WriteStringValue(LinkIdentifier); + } + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RemotePrivateEndpointConnectionDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemotePrivateEndpointConnectionDetails(document.RootElement, options); + } + + internal static RemotePrivateEndpointConnectionDetails DeserializeRemotePrivateEndpointConnectionDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string privateIPAddress = default; + string linkIdentifier = default; + string groupId = default; + string memberName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateIpAddress"u8)) + { + privateIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("linkIdentifier"u8)) + { + linkIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemotePrivateEndpointConnectionDetails( + id, + privateIPAddress, + linkIdentifier, + groupId, + memberName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support writing '{options.Format}' format."); + } + } + + RemotePrivateEndpointConnectionDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemotePrivateEndpointConnectionDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs new file mode 100644 index 000000000000..0337de2a5360 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Private endpoint connection details at member level. + public partial class RemotePrivateEndpointConnectionDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RemotePrivateEndpointConnectionDetails() + { + } + + /// Initializes a new instance of . + /// Gets or sets id. + /// Gets or sets private IP address. + /// Gets or sets link identifier. + /// Gets or sets group id. + /// Gets or sets member name. + /// Keeps track of any properties unknown to the library. + internal RemotePrivateEndpointConnectionDetails(string id, string privateIPAddress, string linkIdentifier, string groupId, string memberName, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateIPAddress = privateIPAddress; + LinkIdentifier = linkIdentifier; + GroupId = groupId; + MemberName = memberName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets id. + public string Id { get; set; } + /// Gets or sets private IP address. + public string PrivateIPAddress { get; set; } + /// Gets or sets link identifier. + public string LinkIdentifier { get; set; } + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs new file mode 100644 index 000000000000..4b770927d859 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ReplicationExtensionModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationExtensionModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + + internal static ReplicationExtensionModelListResult DeserializeReplicationExtensionModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationExtensionData.DeserializeDataReplicationExtensionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicationExtensionModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs new file mode 100644 index 000000000000..c42257d5ea2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ReplicationExtensionModel list operation. + internal partial class ReplicationExtensionModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ReplicationExtensionModel items on this page. + /// is null. + internal ReplicationExtensionModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ReplicationExtensionModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ReplicationExtensionModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReplicationExtensionModelListResult() + { + } + + /// The ReplicationExtensionModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} 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..feaf708372d4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class StorageContainerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("clusterSharedVolumePath"u8); + writer.WriteStringValue(ClusterSharedVolumePath); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageContainerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + + internal static StorageContainerProperties DeserializeStorageContainerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string clusterSharedVolumePath = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterSharedVolumePath"u8)) + { + clusterSharedVolumePath = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageContainerProperties(name, clusterSharedVolumePath, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support writing '{options.Format}' format."); + } + } + + StorageContainerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..b1cd48805258 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Storage container properties. + public partial class StorageContainerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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; + } + + /// Initializes a new instance of . + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// Keeps track of any properties unknown to the library. + internal StorageContainerProperties(string name, string clusterSharedVolumePath, IDictionary serializedAdditionalRawData) + { + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StorageContainerProperties() + { + } + + /// 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/TestFailoverCleanupJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..074bd6ae0c83 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverCleanupJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Comments)) + { + writer.WritePropertyName("comments"u8); + writer.WriteStringValue(Comments); + } + } + + TestFailoverCleanupJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverCleanupJobCustomProperties(document.RootElement, options); + } + + internal static TestFailoverCleanupJobCustomProperties DeserializeTestFailoverCleanupJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string comments = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("comments"u8)) + { + comments = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverCleanupJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, comments); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverCleanupJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTestFailoverCleanupJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs new file mode 100644 index 000000000000..8da682f17645 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover cleanup job model custom properties. + public partial class TestFailoverCleanupJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverCleanupJobCustomProperties() + { + InstanceType = "TestFailoverCleanupJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test failover cleanup comments. + internal TestFailoverCleanupJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, string comments) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + Comments = comments; + InstanceType = instanceType ?? "TestFailoverCleanupJobDetails"; + } + + /// Gets or sets the test failover cleanup comments. + public string Comments { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..76ef7e300c45 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + TestFailoverJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverJobCustomProperties(document.RootElement, options); + } + + internal static TestFailoverJobCustomProperties DeserializeTestFailoverJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTestFailoverJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs new file mode 100644 index 000000000000..6d28f8b032b8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover job model custom properties. + public partial class TestFailoverJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverJobCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "TestFailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test VM details. + internal TestFailoverJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "TestFailoverJobDetails"; + } + + /// Gets or sets the test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..83a23d6452d1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationEventCustomProperties DeserializeUnknownDataReplicationEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationEventCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs new file mode 100644 index 000000000000..ab737e790e79 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationEventCustomProperties. + internal partial class UnknownDataReplicationEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationEventCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c2ce1bfd7884 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationExtensionCustomProperties DeserializeUnknownDataReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationExtensionCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..4ee2b0074542 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationExtensionCustomProperties. + internal partial class UnknownDataReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationExtensionCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..7798ddfb26f9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationFabricAgentCustomProperties DeserializeUnknownDataReplicationFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationFabricAgentCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..d3bdbb783a48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationFabricAgentCustomProperties. + internal partial class UnknownDataReplicationFabricAgentCustomProperties : DataReplicationFabricAgentCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationFabricAgentCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..3a3f4c5dbd54 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationFabricCustomProperties DeserializeUnknownDataReplicationFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationFabricCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs new file mode 100644 index 000000000000..ac9d5ca7db1e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationFabricCustomProperties. + internal partial class UnknownDataReplicationFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationFabricCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..40bb44881dbb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationJobCustomProperties DeserializeUnknownDataReplicationJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs new file mode 100644 index 000000000000..383e0c8382e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationJobCustomProperties. + internal partial class UnknownDataReplicationJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationJobCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ef204d14e178 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationPolicyCustomProperties DeserializeUnknownDataReplicationPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationPolicyCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs new file mode 100644 index 000000000000..2bb868c42baa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationPolicyCustomProperties. + internal partial class UnknownDataReplicationPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationPolicyCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..7ab84420265f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationProtectedItemCustomProperties DeserializeUnknownDataReplicationProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationProtectedItemCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..818ca7ce7472 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationProtectedItemCustomProperties. + internal partial class UnknownDataReplicationProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationProtectedItemCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..5f8427b982ff --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static UnknownDataReplicationProtectedItemCustomPropertiesUpdate DeserializeUnknownDataReplicationProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationProtectedItemCustomPropertiesUpdate(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..04e22418a734 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationProtectedItemCustomPropertiesUpdate. + internal partial class UnknownDataReplicationProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationProtectedItemCustomPropertiesUpdate() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..9b3200ed5637 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationRecoveryPointCustomProperties DeserializeUnknownDataReplicationRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..73f536d6dcac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationRecoveryPointCustomProperties. + internal partial class UnknownDataReplicationRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationRecoveryPointCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c23a478d3c91 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + PlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static UnknownPlannedFailoverCustomProperties DeserializeUnknownPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..d733e7e7d101 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of PlannedFailoverCustomProperties. + internal partial class UnknownPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownPlannedFailoverCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..82006d004fbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("biosId"u8); + writer.WriteStringValue(BiosId); + writer.WritePropertyName("marsAuthenticationIdentity"u8); + writer.WriteObjectValue(MarsAuthenticationIdentity, options); + } + + VMwareFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareFabricAgentCustomProperties(document.RootElement, options); + } + + internal static VMwareFabricAgentCustomProperties DeserializeVMwareFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string biosId = default; + DataReplicationIdentity marsAuthenticationIdentity = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("biosId"u8)) + { + biosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marsAuthenticationIdentity"u8)) + { + marsAuthenticationIdentity = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareFabricAgentCustomProperties(instanceType, serializedAdditionalRawData, biosId, marsAuthenticationIdentity); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..45d542e0359d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware fabric agent model custom properties. + public partial class VMwareFabricAgentCustomProperties : DataReplicationFabricAgentCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + /// or is null. + public VMwareFabricAgentCustomProperties(string biosId, DataReplicationIdentity marsAuthenticationIdentity) + { + Argument.AssertNotNull(biosId, nameof(biosId)); + Argument.AssertNotNull(marsAuthenticationIdentity, nameof(marsAuthenticationIdentity)); + + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = "VMware"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + internal VMwareFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string biosId, DataReplicationIdentity marsAuthenticationIdentity) : base(instanceType, serializedAdditionalRawData) + { + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = instanceType ?? "VMware"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareFabricAgentCustomProperties() + { + } + + /// Gets or sets the BIOS Id of the fabric agent machine. + public string BiosId { get; set; } + /// Identity model. + public DataReplicationIdentity MarsAuthenticationIdentity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..6d0ed2e49d8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareMigrateFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + } + + VMwareMigrateFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareMigrateFabricCustomProperties(document.RootElement, options); + } + + internal static VMwareMigrateFabricCustomProperties DeserializeVMwareMigrateFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier vmwareSiteId = default; + ResourceIdentifier migrationSolutionId = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareMigrateFabricCustomProperties(instanceType, serializedAdditionalRawData, vmwareSiteId, migrationSolutionId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareMigrateFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareMigrateFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs new file mode 100644 index 000000000000..cfb0cf0099d9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs @@ -0,0 +1,53 @@ +// 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 +{ + /// VMware migrate fabric model custom properties. + public partial class VMwareMigrateFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + /// or is null. + public VMwareMigrateFabricCustomProperties(ResourceIdentifier vmwareSiteId, ResourceIdentifier migrationSolutionId) + { + Argument.AssertNotNull(vmwareSiteId, nameof(vmwareSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "VMwareMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + internal VMwareMigrateFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareSiteId, ResourceIdentifier migrationSolutionId) : base(instanceType, serializedAdditionalRawData) + { + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = instanceType ?? "VMwareMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareMigrateFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the VMware site. + public ResourceIdentifier VmwareSiteId { get; set; } + /// Gets or sets the ARM Id of the migration solution. + public ResourceIdentifier 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..d4ea284a1106 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support writing '{format}' format."); + } + + 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); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciDiskInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciDiskInput(document.RootElement, options); + } + + internal static VMwareToAzStackHciDiskInput DeserializeVMwareToAzStackHciDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + ResourceIdentifier storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DataReplicationDiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(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; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DataReplicationDiskControllerInputs.DeserializeDataReplicationDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..01df92aa0379 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.cs @@ -0,0 +1,123 @@ +// 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 +{ + /// VMwareToAzStack disk input. + public partial class VMwareToAzStackHciDiskInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// 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 . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciDiskInput(string diskId, ResourceIdentifier storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DataReplicationDiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public ResourceIdentifier 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; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DataReplicationDiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..948836ded1b0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + VMwareToAzStackHciEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciEventCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciEventCustomProperties DeserializeVMwareToAzStackHciEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciEventCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs new file mode 100644 index 000000000000..56b31bf94ea9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware 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 VMwareToAzStackHciEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHciEventCustomProperties() + { + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 VMwareToAzStackHciEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// 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/VMwareToAzStackHciNicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs new file mode 100644 index 000000000000..9c8903cea454 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciNicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciNicInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciNicInput(document.RootElement, options); + } + + internal static VMwareToAzStackHciNicInput DeserializeVMwareToAzStackHciNicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string label = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciNicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciNicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciNicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..b8851668908c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHciNicInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the selection type of the NIC. + /// or is null. + public VMwareToAzStackHciNicInput(string nicId, string label, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + Argument.AssertNotNull(label, nameof(label)); + + NicId = nicId; + Label = label; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciNicInput(string nicId, string label, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + Label = label; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciNicInput() + { + } + + /// 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; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a76ddb4811a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + VMwareToAzStackHciPlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciPlannedFailoverCustomProperties DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciPlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..1e8806865740 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI planned failover model custom properties. + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal VMwareToAzStackHciPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciPlannedFailoverCustomProperties() + { + } + + /// 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/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a4cfb0771a91 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + VMwareToAzStackHciPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciPolicyCustomProperties DeserializeVMwareToAzStackHciPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciPolicyCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs new file mode 100644 index 000000000000..8291589dda12 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware To AzStackHCI Policy model custom properties. + public partial class VMwareToAzStackHciPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// 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 VMwareToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 VMwareToAzStackHciPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciPolicyCustomProperties() + { + } + + /// 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..2b3ee1a246d4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.Serialization.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciProtectedDiskProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedDiskProperties DeserializeVMwareToAzStackHciProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(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; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..ed12b6b3e604 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.cs @@ -0,0 +1,118 @@ +// 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 +{ + /// VMwareToAzStackHCI protected disk properties. + public partial class VMwareToAzStackHciProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHciProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// 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. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public ResourceIdentifier 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; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..5d04235a73af --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + 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, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceivedOn)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceivedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(MigrationProgressPercentage)) + { + writer.WritePropertyName("migrationProgressPercentage"u8); + writer.WriteNumberValue(MigrationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeProgressPercentage)) + { + writer.WritePropertyName("resumeProgressPercentage"u8); + writer.WriteNumberValue(ResumeProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRetryCount)) + { + writer.WritePropertyName("resyncRetryCount"u8); + writer.WriteNumberValue(ResyncRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(ResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncState)) + { + writer.WritePropertyName("resyncState"u8); + writer.WriteStringValue(ResyncState.Value.ToString()); + } + if (Optional.IsDefined(PerformAutoResync)) + { + writer.WritePropertyName("performAutoResync"u8); + writer.WriteBooleanValue(PerformAutoResync.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeRetryCount)) + { + writer.WritePropertyName("resumeRetryCount"u8); + writer.WriteNumberValue(ResumeRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + VMwareToAzStackHciProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedItemCustomProperties DeserializeVMwareToAzStackHciProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + ResourceIdentifier targetHciClusterId = default; + ResourceIdentifier targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + ResourceIdentifier storageContainerId = default; + ResourceIdentifier targetResourceGroupId = default; + string targetLocation = default; + string customLocationRegion = default; + IList disksToInclude = default; + IList nicsToInclude = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + string targetVmName = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string osName = default; + string firmwareType = default; + ResourceIdentifier fabricDiscoveryMachineId = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? migrationProgressPercentage = default; + int? resumeProgressPercentage = default; + int? resyncProgressPercentage = default; + long? resyncRetryCount = default; + bool? resyncRequired = default; + VMwareToAzureMigrateResyncState? resyncState = default; + bool? performAutoResync = default; + long? resumeRetryCount = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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 = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = new ResourceIdentifier(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, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciNicInput.DeserializeVMwareToAzStackHciNicInput(item, options)); + } + 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, options)); + } + 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, options)); + } + 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, options); + 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 = new ResourceIdentifier(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("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedItemCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + storageContainerId, + targetResourceGroupId, + targetLocation, + customLocationRegion, + disksToInclude, + nicsToInclude, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + targetVmName, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType, + osName, + firmwareType, + fabricDiscoveryMachineId, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateTime); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..9dbfacd40210 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs @@ -0,0 +1,262 @@ +// 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 VMwareToAzStackHciProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// 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 fabric agent name. + /// Gets or sets the target fabric agent name. + /// , , , , , , , , , , or is null. + public VMwareToAzStackHciProtectedItemCustomProperties(ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, ResourceIdentifier storageContainerId, ResourceIdentifier targetResourceGroupId, string customLocationRegion, IEnumerable disksToInclude, IEnumerable nicsToInclude, string hyperVGeneration, ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) + { + 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(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + + 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; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 fabric agent name. + /// Gets or sets the target fabric agent 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 VMwareToAzStackHciProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, string targetAzStackHciClusterName, ResourceIdentifier storageContainerId, ResourceIdentifier 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, ResourceIdentifier fabricDiscoveryMachineId, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceivedOn, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? migrationProgressPercentage, int? resumeProgressPercentage, int? resyncProgressPercentage, long? resyncRetryCount, bool? resyncRequired, VMwareToAzureMigrateResyncState? resyncState, bool? performAutoResync, long? resumeRetryCount, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + 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; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceivedOn = lastRecoveryPointReceivedOn; + 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"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciProtectedItemCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public ResourceIdentifier TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public ResourceIdentifier 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 ResourceIdentifier StorageContainerId { get; set; } + /// Gets or sets the target resource group ARM Id. + public ResourceIdentifier 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 ResourceIdentifier 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 fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { 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? LastRecoveryPointReceivedOn { 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/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..88b17d1cb06a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + 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, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + VMwareToAzStackHciProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedItemCustomPropertiesUpdate DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciNicInput.DeserializeVMwareToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + 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, options); + 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("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedItemCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..12a58fef778f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// 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. + internal VMwareToAzStackHciProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// 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; set; } + } +} 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..b47306bdd491 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(Label)) + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + if (Optional.IsDefined(IsPrimaryNic)) + { + writer.WritePropertyName("isPrimaryNic"u8); + writer.WriteBooleanValue(IsPrimaryNic.Value); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciProtectedNicProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedNicProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedNicProperties DeserializeVMwareToAzStackHciProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string label = default; + bool? isPrimaryNic = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedNicProperties( + nicId, + macAddress, + label, + isPrimaryNic, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..c7b97818ff05 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHciProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHciProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// 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. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciProtectedNicProperties(string nicId, string macAddress, string label, bool? isPrimaryNic, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + Label = label; + IsPrimaryNic = isPrimaryNic; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a02b98fd2e61 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + VMwareToAzStackHciRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciRecoveryPointCustomProperties DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..16ac151433bb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI recovery point model custom properties. + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHciRecoveryPointCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal VMwareToAzStackHciRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..59a4ff3c7ab0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareFabricArmId"u8); + writer.WriteStringValue(VmwareFabricArmId); + if (options.Format != "W" && Optional.IsDefined(VmwareSiteId)) + { + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + VMwareToAzStackHciReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciReplicationExtensionCustomProperties DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier vmwareFabricArmId = default; + ResourceIdentifier vmwareSiteId = default; + ResourceIdentifier azStackHciFabricArmId = default; + ResourceIdentifier azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + Uri asrServiceUri = default; + Uri rcmServiceUri = default; + Uri gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareFabricArmId"u8)) + { + vmwareFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmwareSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmwareSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azStackHciSiteId = new ResourceIdentifier(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; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciReplicationExtensionCustomProperties( + instanceType, + serializedAdditionalRawData, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..3eb055f7b13a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs @@ -0,0 +1,109 @@ +// 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 +{ + /// VMware to AzStackHCI Replication extension model custom properties. + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// 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 VMwareToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier vmwareFabricArmId, ResourceIdentifier azStackHciFabricArmId) + { + Argument.AssertNotNull(vmwareFabricArmId, nameof(vmwareFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + VmwareFabricArmId = vmwareFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + /// 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 VMwareToAzStackHciReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareFabricArmId, ResourceIdentifier vmwareSiteId, ResourceIdentifier azStackHciFabricArmId, ResourceIdentifier 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, serializedAdditionalRawData) + { + 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"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciReplicationExtensionCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source VMware fabric. + public ResourceIdentifier VmwareFabricArmId { get; set; } + /// Gets or sets the ARM Id of the VMware site. + public ResourceIdentifier VmwareSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public ResourceIdentifier AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier 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..86cd45ebfb00 --- /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 state. + public static VMwareToAzureMigrateResyncState None { get; } = new VMwareToAzureMigrateResyncState(NoneValue); + /// Prepared for resynchronization state. + public static VMwareToAzureMigrateResyncState PreparedForResynchronization { get; } = new VMwareToAzureMigrateResyncState(PreparedForResynchronizationValue); + /// Started resynchronization state. + 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs new file mode 100644 index 000000000000..bf6d33545a7c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class VaultModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VaultModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelListResult(document.RootElement, options); + } + + internal static VaultModelListResult DeserializeVaultModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationVaultData.DeserializeDataReplicationVaultData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VaultModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerRecoveryServicesDataReplicationContext.Default); + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{options.Format}' format."); + } + } + + VaultModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVaultModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs new file mode 100644 index 000000000000..faf0723c4776 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a VaultModel list operation. + internal partial class VaultModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The VaultModel items on this page. + /// is null. + internal VaultModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VaultModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VaultModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VaultModelListResult() + { + } + + /// The VaultModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} 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..1b7b81e237db --- /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"; + + /// Not Selected. + public static VmNicSelection NotSelected { get; } = new VmNicSelection(NotSelectedValue); + /// Selected by user. + public static VmNicSelection SelectedByUser { get; } = new VmNicSelection(SelectedByUserValue); + /// Default selection by ASR. + public static VmNicSelection SelectedByDefault { get; } = new VmNicSelection(SelectedByDefaultValue); + /// NIC configuration overridden by user. Differs from SelectedByUser in the sense that the legacy SelectedByUser is used both for explicit modification by user and implicit approval of user if the settings are used for TFO/FO. SelectedByUserOverride implies user overriding at least one of the configurations. + 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 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 != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} 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..c468763062c9 --- /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/RestOperations/CheckNameAvailabilityRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs new file mode 100644 index 000000000000..a5d5c901ac68 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class CheckNameAvailabilityRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CheckNameAvailabilityRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CheckNameAvailabilityRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content) + { + 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); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/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 (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// 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> PostAsync(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationNameAvailabilityResult.DeserializeDataReplicationNameAvailabilityResult(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 Post(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationNameAvailabilityResult.DeserializeDataReplicationNameAvailabilityResult(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/DeploymentPreflightRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs new file mode 100644 index 000000000000..de8ca70d59fe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class DeploymentPreflightRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeploymentPreflightRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DeploymentPreflightRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body) + { + 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); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Performs resource deployment preflight 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> PostAsync(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflight value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeploymentPreflight.DeserializeDeploymentPreflight(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs resource deployment preflight 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 Post(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflight value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeploymentPreflight.DeserializeDeploymentPreflight(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..e1f15eaa2bfc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + 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); + return uri; + } + + 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: + { + DataReplicationEmailConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEmailConfigurationData)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: + { + DataReplicationEmailConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEmailConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationEmailConfigurationData 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: + { + DataReplicationEmailConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(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, DataReplicationEmailConfigurationData 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: + { + DataReplicationEmailConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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); + return uri; + } + + 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: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(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: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(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: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(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..88441d3676c4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + 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); + return uri; + } + + 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: + { + DataReplicationEventData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEventData.DeserializeDataReplicationEventData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEventData)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: + { + DataReplicationEventData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEventData.DeserializeDataReplicationEventData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEventData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EventModelListResult.DeserializeEventModelListResult(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/FabricAgentRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs new file mode 100644 index 000000000000..5f3a4204ac74 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class FabricAgentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricAgentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FabricAgentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + 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); + return uri; + } + + 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 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: + { + DataReplicationFabricAgentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricAgentData)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 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: + { + DataReplicationFabricAgentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricAgentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData 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, ModelSerializationExtensions.WireOptions); + 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 name. + /// Fabric agent 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, DataReplicationFabricAgentData 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 name. + /// Fabric agent 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, DataReplicationFabricAgentData 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 RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + 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); + return uri; + } + + 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 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 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 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 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + 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); + return uri; + } + + 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: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(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: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(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: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(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..abd43c6217dc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + 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); + return uri; + } + + 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: + { + DataReplicationFabricData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationFabricData.DeserializeDataReplicationFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricData)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: + { + DataReplicationFabricData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationFabricData.DeserializeDataReplicationFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationFabricData 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, DataReplicationFabricData 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 RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch 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); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationFabricPatch 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, DataReplicationFabricPatch 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 RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + 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); + return uri; + } + + 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + 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); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, 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: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(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: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", 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 fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(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. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(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: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// 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. + /// 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, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(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. + /// 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, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(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/JobRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs new file mode 100644 index 000000000000..f053e81f3639 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class JobRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of JobRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public JobRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + 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 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: + { + DataReplicationJobData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationJobData.DeserializeDataReplicationJobData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationJobData)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 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: + { + DataReplicationJobData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationJobData.DeserializeDataReplicationJobData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationJobData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = JobModelListResult.DeserializeJobModelListResult(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..d0226a05de63 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + 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); + return uri; + } + + 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: + { + DataReplicationPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPolicyData.DeserializeDataReplicationPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPolicyData)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: + { + DataReplicationPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPolicyData.DeserializeDataReplicationPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationPolicyData 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, DataReplicationPolicyData 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 RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + 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); + return uri; + } + + 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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); + return uri; + } + + 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: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(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: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(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: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PolicyModelListResult.DeserializePolicyModelListResult(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/PrivateEndpointConnectionProxiesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs new file mode 100644 index 000000000000..dc659b812480 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionProxiesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionProxiesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionProxiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection proxy details. + /// 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 private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection proxy details. + /// 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 private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// 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 private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// 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 private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// 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 private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// 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 private endpoint connection proxy 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 privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + 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("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections proxies. + /// 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: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// 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: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateValidateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateValidateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + 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("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Returns remote private endpoint connection information after validation. + /// 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 private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ValidateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns remote private endpoint connection information after validation. + /// 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 private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Validate(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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 all private endpoint connections proxies. + /// 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: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// 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: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(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/PrivateEndpointConnectionsRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 000000000000..2b77aee4c22f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + 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("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + 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("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection details. + /// 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 private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection details. + /// 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 private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData 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("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// 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 private endpoint connection name. + /// Private endpoint connection update input. + /// 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, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// 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 private endpoint connection name. + /// Private endpoint connection update input. + /// 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, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + 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("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + 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("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the private endpoint connection. + /// 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 private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + 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 private endpoint connection. + /// 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 private endpoint connection 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 privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + 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("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections configured 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 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: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured 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 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: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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 all private endpoint connections configured on the 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: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured on the 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: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(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/PrivateLinkResourcesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs new file mode 100644 index 000000000000..2cdfcae8a289 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + 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("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + 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("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, 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 site recovery private link resource. + /// 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 private link 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 privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of site recovery private link resource. + /// 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 private link 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 privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + 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("/privateLinkResources", 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 private link resources. + /// 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: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// 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: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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 private link resources. + /// 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: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// 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: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(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..fd421d719985 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + 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); + return uri; + } + + 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: + { + DataReplicationProtectedItemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationProtectedItemData)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: + { + DataReplicationProtectedItemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationProtectedItemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationProtectedItemData 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, DataReplicationProtectedItemData 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 RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch 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.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch 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.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(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update 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. + /// 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 UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch, 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(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, 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 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 Update(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch, 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(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + 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); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + return uri; + } + + 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); + uri.AppendQuery("api-version", _apiVersion, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePlannedFailoverRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover body) + { + 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); + return uri; + } + + internal HttpMessage CreatePlannedFailoverRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover 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"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + 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, PlannedFailover body, 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(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + 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, PlannedFailover body, 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(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + 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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(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. + /// OData options. + /// Continuation token. + /// Page size. + /// 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 odataOptions = null, string continuationToken = null, int? pageSize = 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, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(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/RecoveryPointRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs new file mode 100644 index 000000000000..f11dd146eb66 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class RecoveryPointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RecoveryPointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public RecoveryPointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.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); + return uri; + } + + 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: + { + DataReplicationRecoveryPointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationRecoveryPointData)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: + { + DataReplicationRecoveryPointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationRecoveryPointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + 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); + return uri; + } + + 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: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(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: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(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: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(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..24cec8e1fd6a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + 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); + return uri; + } + + 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: + { + DataReplicationExtensionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationExtensionData.DeserializeDataReplicationExtensionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationExtensionData)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: + { + DataReplicationExtensionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationExtensionData.DeserializeDataReplicationExtensionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationExtensionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationExtensionData 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, DataReplicationExtensionData 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 RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + 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); + return uri; + } + + 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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); + return uri; + } + + 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: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(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: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(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: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(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..d372fe55b069 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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. + /// Service host. + /// The API version to use for this operation. + /// 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 ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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); + return uri; + } + + 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: + { + DataReplicationVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationVaultData.DeserializeDataReplicationVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationVaultData)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: + { + DataReplicationVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationVaultData.DeserializeDataReplicationVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationVaultData 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, DataReplicationVaultData 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 RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch 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); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch 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, ModelSerializationExtensions.WireOptions); + 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, DataReplicationVaultPatch 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, DataReplicationVaultPatch 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 RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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); + return uri; + } + + 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 RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + 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.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + 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); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, 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: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(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: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", 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 vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(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. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + 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: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(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: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// 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. + /// 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, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(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. + /// 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, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} 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..f3484b477c5e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.RecoveryServicesDataReplication.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("RecoveryServicesDataReplication")] 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..28b8be380881 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + 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..c22207cd3bbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +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..f82e1be89d2f --- /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 + { + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml new file mode 100644 index 000000000000..bc30526b1673 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/recoveryservicesdatareplication/DataReplication.Management +commit: 8c66935c38087d89b19bff47152ee5d8d99a73ec +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/recoveryservicesdatareplication/ci.mgmt.yml b/sdk/recoveryservicesdatareplication/ci.mgmt.yml new file mode 100644 index 000000000000..cdff4215bc6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/ci.mgmt.yml @@ -0,0 +1,26 @@ +# 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 + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.RecoveryServicesDataReplication + safeName: AzureResourceManagerRecoveryServicesDataReplication diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 9ae0a7e75290..685fc0437a29 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -169,6 +169,7 @@ trigger: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay @@ -385,6 +386,7 @@ pr: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/